For other objects we use the two functions rather than one with a bool.
Convert qemuSetImageCgroup to the same approach.
---
src/qemu/qemu_cgroup.c | 17 ++++++++++++-----
src/qemu/qemu_cgroup.h | 7 ++++---
src/qemu/qemu_driver.c | 4 ++--
3 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index b37af6d..978dfa2 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -99,11 +99,18 @@ qemuSetImageCgroupInternal(virDomainObjPtr vm,
int
-qemuSetImageCgroup(virDomainObjPtr vm,
- virStorageSourcePtr src,
- bool deny)
+qemuSetupImageCgroup(virDomainObjPtr vm,
+ virStorageSourcePtr src)
{
- return qemuSetImageCgroupInternal(vm, src, deny, false);
+ return qemuSetImageCgroupInternal(vm, src, false, false);
+}
+
+
+int
+qemuTeardownImageCgroup(virDomainObjPtr vm,
+ virStorageSourcePtr src)
+{
+ return qemuSetImageCgroupInternal(vm, src, true, false);
}
@@ -133,7 +140,7 @@ qemuTeardownDiskCgroup(virDomainObjPtr vm,
virStorageSourcePtr next;
for (next = disk->src; next; next = next->backingStore) {
- if (qemuSetImageCgroup(vm, next, true) < 0)
+ if (qemuSetImageCgroupInternal(vm, next, true, false) < 0)
return -1;
}
diff --git a/src/qemu/qemu_cgroup.h b/src/qemu/qemu_cgroup.h
index a31fa34..a8b8e1b 100644
--- a/src/qemu/qemu_cgroup.h
+++ b/src/qemu/qemu_cgroup.h
@@ -29,9 +29,10 @@
# include "domain_conf.h"
# include "qemu_conf.h"
-int qemuSetImageCgroup(virDomainObjPtr vm,
- virStorageSourcePtr src,
- bool deny);
+int qemuSetupImageCgroup(virDomainObjPtr vm,
+ virStorageSourcePtr src);
+int qemuTeardownImageCgroup(virDomainObjPtr vm,
+ virStorageSourcePtr src);
int qemuSetupDiskCgroup(virDomainObjPtr vm,
virDomainDiskDefPtr disk);
int qemuTeardownDiskCgroup(virDomainObjPtr vm,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index fa1d9b7..be42d77 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13374,7 +13374,7 @@ qemuDomainPrepareDiskChainElement(virQEMUDriverPtr driver,
vm->def, elem) < 0)
VIR_WARN("Unable to restore security label on %s", elem->path);
- if (qemuSetImageCgroup(vm, elem, true) < 0)
+ if (qemuTeardownImageCgroup(vm, elem) < 0)
VIR_WARN("Failed to teardown cgroup for disk path %s",
elem->path);
if (virDomainLockImageDetach(driver->lockManager, vm, elem) < 0)
@@ -13384,7 +13384,7 @@ qemuDomainPrepareDiskChainElement(virQEMUDriverPtr driver,
vm, elem) < 0)
goto cleanup;
- if (qemuSetImageCgroup(vm, elem, false) < 0)
+ if (qemuSetupImageCgroup(vm, elem) < 0)
goto cleanup;
if (virSecurityManagerSetImageLabel(driver->securityManager,
--
2.6.2