[PATCH 2/3] Fix release of locks with dlm plugin

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

 



The dlm lock plugin couldn't release locks when the vm instance
was destroyed, kill manually because that we can't use file
descriptor which couldn't adopt after libvirtd reboot to be
aware of the process dead, we need to proactively to release
the lock just like unlink the <domain>.xml and <domain>.pid
files. This operation could be found in libxl.

Signed-off-by: river <lfu@xxxxxxxx>
---
 src/qemu/qemu_process.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 5a364730c..49c64be6f 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6626,6 +6626,11 @@ void qemuProcessStop(virQEMUDriverPtr driver,
 
     qemuProcessRemoveDomainStatus(driver, vm);
 
+    VIR_FREE(priv->lockState);
+    if (virDomainLockProcessPause(driver->lockManager, vm, &priv->lockState) < 0)
+        VIR_WARN("Unable to release lease on %s", vm->def->name);
+    VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState));
+
     /* Remove VNC and Spice ports from port reservation bitmap, but only if
        they were reserved by the driver (autoport=yes)
     */
-- 
2.15.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux