]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: make sure capability probing process can start
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 9 Oct 2014 06:18:33 +0000 (08:18 +0200)
committerCole Robinson <crobinso@redhat.com>
Sat, 15 Nov 2014 21:02:07 +0000 (16:02 -0500)
When daemon is killed right in the middle of probing a qemu binary for
its capabilities, the qemu process is left running.  Next time the
daemon is starting, it cannot start the probing qemu process because the
one that's already running does have the pidfile flock()'d.

Reported-by: Wang Yufei <james.wangyufei@huawei.com>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
(cherry picked from commit 0ed1b55b20300e0ea53925349d918935c2114bf2)

src/qemu/qemu_capabilities.c

index 60140b168de4c2dbab8be0bc162095a8df8396b9..668fc38f8b5652ece6799df239a0022f177f862d 100644 (file)
@@ -3241,6 +3241,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);
 
     /*