computing-offload/generic_vdpa/libvirt/qemu_cgroup-Drop-ENOENT-special-case-for-RNG-devices.patch
jiangdongxu 79c4324644 add generic_vdpa basecode
Change-Id: I2d302dda68298877c65c99147f5bf22186a59aac
2024-09-19 17:19:46 +08:00

45 lines
1.6 KiB
Diff

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