1 Star 0 Fork 71

lIshaohui/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
qemu_cgroup-Drop-ENOENT-special-case-for-RNG-devices.patch 1.64 KB
一键复制 编辑 原始数据 按行查看 历史
Jiangjiacheng 提交于 2023-01-04 12:02 . Backport patches from upstream
From fccb7c2ccec7fe9a831be04e589b5fb56a048828 Mon Sep 17 00:00:00 2001
From: xuyinghao <xuyinghao2@huawei.com>
Date: Tue, 9 Aug 2022 18:58:05 +0800
Subject: [PATCH 13/22] qemu_cgroup: Drop ENOENT special case for RNG devices
Description: When allowing or denying RNG device in CGroups there's a special check if the backend device exists (errno == ENOENT) in which case success is returned to caller. This is in contrast with the rest of the functions and in fact wrong too - if the backend device doesn't exist then QEMU will fail opening it. Might as well signal error here.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
---
src/qemu/qemu_cgroup.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index aa721df100..c30ede7394 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -667,9 +667,9 @@ qemuSetupRNGCgroup(virDomainObjPtr vm,
virDomainAuditCgroupPath(vm, priv->cgroup, "allow",
rng->source.file,
"rw", rv);
- if (rv < 0 &&
- !virLastErrorIsSystemErrno(ENOENT))
+ if (rv < 0) {
return -1;
+ }
}
return 0;
@@ -694,9 +694,9 @@ qemuTeardownRNGCgroup(virDomainObjPtr vm,
virDomainAuditCgroupPath(vm, priv->cgroup, "deny",
rng->source.file,
"rw", rv);
- if (rv < 0 &&
- !virLastErrorIsSystemErrno(ENOENT))
+ if (rv < 0) {
return -1;
+ }
}
return 0;
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/li-shaohui/libvirt.git
git@gitee.com:li-shaohui/libvirt.git
li-shaohui
libvirt
libvirt
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385