[PATCH v2 2/2] qemu: make sure capability probing process can start

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

 



When daemon is killed right in the middle of probing a qemu binary for
its capabilities, the VM is left running.  Next time the daemon is
starting, it cannot start qemu process because the one that's already
running does have the pidfile flock()'d.

Reported-by: Wang Yufei <james.wangyufei@xxxxxxxxxx>

Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
v2:
 - Don't use "/proc", but simply just try to acquire the pidfile.
 - https://www.redhat.com/archives/libvir-list/2014-October/msg00320.html

 src/qemu/qemu_capabilities.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 6fcb5c7..8aedf3f 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -3243,6 +3243,8 @@ virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps,
     config.data.nix.path = monpath;
     config.data.nix.listen = false;

+    virPidFileForceCleanupPath(pidfile);
+
     VIR_DEBUG("Try to get caps via QMP qemuCaps=%p", qemuCaps);

     /*
--
2.1.2

--
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]