}
+static int
+qemuCgroupAllowDevicesPaths(virDomainObj *vm,
+ const char *const *deviceACL,
+ int perms,
+ bool ignoreEacces)
+{
+ 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))
+ return -1;
+ }
+
+ return 0;
+}
+
+
static int
qemuCgroupDenyDevicePath(virDomainObj *vm,
const char *path,
return -1;
}
+ if (!deviceACL)
+ deviceACL = defaultDeviceACL;
+
+ if (qemuCgroupAllowDevicesPaths(vm, deviceACL, VIR_CGROUP_DEVICE_RW, false) < 0)
+ return -1;
+
if (qemuSetupFirmwareCgroup(vm) < 0)
return -1;
if (rv < 0)
return -1;
- if (!deviceACL)
- deviceACL = defaultDeviceACL;
-
if (vm->def->nsounds &&
((!vm->def->ngraphics && cfg->nogfxAllowHostAudio) ||
(vm->def->graphics &&
return -1;
}
- for (i = 0; deviceACL[i] != NULL; i++) {
- if (!virFileExists(deviceACL[i])) {
- VIR_DEBUG("Ignoring non-existent device %s", deviceACL[i]);
- continue;
- }
-
- rv = qemuCgroupAllowDevicePath(vm, deviceACL[i], VIR_CGROUP_DEVICE_RW, false);
- if (rv < 0 &&
- !virLastErrorIsSystemErrno(ENOENT))
- return -1;
- }
-
if (virDomainChrDefForeach(vm->def,
true,
qemuSetupChardevCgroupCB,