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 <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Michal Privoznik 2022-07-27 10:31:03 +02:00
parent 23d4684640
commit bad581466e

View 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;
}