diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index a6a1a5ab7cecfcbc02fd2f93f6e761b6072785ef..4639478abc61d34ce4bb3bed28fe740567d4596e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5491,7 +5491,7 @@ static int qemudDomainAttachDevice(virDomainPtr dom, virDomainDiskDeviceTypeToString(dev->data.disk->device)); /* Fallthrough */ } - if (ret != 0) { + if (ret != 0 && cgroup) { virCgroupDenyDevicePath(cgroup, dev->data.disk->src); }