[PATCH v14 06/15] qemu_cgroup: Don't ignore ENOENT in qemuCgroupAllowDevicesPaths()

Michal Privoznik mprivozn at redhat.com
Wed Jul 27 10:34:52 UTC 2022


There's no need to skip over ENOENT error in
qemuCgroupAllowDevicesPaths(). The path must exists when
qemuCgroupAllowDevicePath() is called because of virFileExists()
check done right above.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/qemu/qemu_cgroup.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index 51702b52e1..d6f27a5a4d 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -76,16 +76,12 @@ qemuCgroupAllowDevicesPaths(virDomainObj *vm,
     size_t i;
 
     for (i = 0; deviceACL[i] != NULL; i++) {
-        int rv;
-
         if (!virFileExists(deviceACL[i])) {
             VIR_DEBUG("Ignoring non-existent device %s", deviceACL[i]);
             continue;
         }
 
-        rv = qemuCgroupAllowDevicePath(vm, deviceACL[i], perms, ignoreEacces);
-        if (rv < 0 &&
-            !virLastErrorIsSystemErrno(ENOENT))
+        if (qemuCgroupAllowDevicePath(vm, deviceACL[i], perms, ignoreEacces) < 0)
             return -1;
     }
 
-- 
2.35.1



More information about the libvir-list mailing list