[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 09/11] qemuDomainDiskChainElement{Prepare, Revoke}: manage /dev entry



Again, one missed bit. This time without this commit there is no
/dev entry when doing disk snapshots.

Signed-off-by: Michal Privoznik <mprivozn redhat com>
---
 src/qemu/qemu_domain.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 5db8b60c5..9e34d73be 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5090,14 +5090,17 @@ qemuDomainDiskChainElementRevoke(virQEMUDriverPtr driver,
                                  virDomainObjPtr vm,
                                  virStorageSourcePtr elem)
 {
-    if (virSecurityManagerRestoreImageLabel(driver->securityManager,
-                                            vm->def, elem) < 0)
-        VIR_WARN("Unable to restore security label on %s", NULLSTR(elem->path));
-
     if (qemuTeardownImageCgroup(vm, elem) < 0)
         VIR_WARN("Failed to teardown cgroup for disk path %s",
                  NULLSTR(elem->path));
 
+    if (virSecurityManagerRestoreImageLabel(driver->securityManager,
+                                            vm->def, elem) < 0)
+        VIR_WARN("Unable to restore security label on %s", NULLSTR(elem->path));
+
+    if (qemuDomainNamespaceTeardownDisk(driver, vm, elem) < 0)
+        VIR_WARN("Unable to remove /dev entry for %s", NULLSTR(elem->path));
+
     if (virDomainLockImageDetach(driver->lockManager, vm, elem) < 0)
         VIR_WARN("Unable to release lock on %s", NULLSTR(elem->path));
 }
@@ -5126,6 +5129,9 @@ qemuDomainDiskChainElementPrepare(virQEMUDriverPtr driver,
     if (virDomainLockImageAttach(driver->lockManager, cfg->uri, vm, elem) < 0)
         goto cleanup;
 
+    if (qemuDomainNamespaceSetupDisk(driver, vm, elem) < 0)
+        goto cleanup;
+
     if (qemuSetupImageCgroup(vm, elem) < 0)
         goto cleanup;
 
-- 
2.11.0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]