From: Michal Privoznik Date: Wed, 27 Jul 2022 08:31:03 +0000 (+0200) Subject: qemu_cgroup: Don't ignore ENOENT in qemuCgroupAllowDevicesPaths() X-Git-Tag: v8.7.0-rc1~251 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bad581466e88eee6390bd9680b4ad959d9ea59ed;p=thirdparty%2Flibvirt.git qemu_cgroup: Don't ignore ENOENT in qemuCgroupAllowDevicesPaths() 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 Reviewed-by: Peter Krempa --- 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; }