]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/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)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 3 Nov 2014 15:43:23 +0000 (16:43 +0100)
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>
src/qemu/qemu_capabilities.c

index b6c0f1b06e4874ed2e769dc9eb481d91ccd842d4..ec6614a68f909bf2bde1a7885d6f45113d2c42cc 100644 (file)
@@ -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);
 
     /*