]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_cgroup: Don't ignore ENOENT in qemuCgroupAllowDevicesPaths()
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 27 Jul 2022 08:31:03 +0000 (10:31 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 1 Aug 2022 08:36:42 +0000 (10:36 +0200)
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@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_cgroup.c

index 51702b52e1a993dddfcb7c0fb9a614c9dc213624..d6f27a5a4d565e488ee11ce617a5903aae1f39f3 100644 (file)
@@ -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;
     }