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

Peter Krempa pkrempa at redhat.com
Thu Oct 30 09:42:05 UTC 2014


On 10/12/14 14:12, Martin Kletzander wrote:
> 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

s/VM/qemu process/ ? The qemu isn't running anything so it might confuse
someone.

> 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 at huawei.com>
> 
> Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
> ---
> 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);
> 
>      /*

ACK. It is a bugfix, but the code path is is critical. I'm leaning
towards pushing this before the freeze but I'd feel better with yet
another opinion.

Peter


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141030/8ac158b2/attachment-0001.sig>


More information about the libvir-list mailing list