[libvirt] [Question] capabilities.pidfile is left behind while starting and stopping libvirtd repeatly

Martin Kletzander mkletzan at redhat.com
Tue Sep 30 14:47:14 UTC 2014


On Tue, Sep 30, 2014 at 05:34:54PM +0800, Wang Yufei wrote:
>Hi, all
>
>I started and stopped libvirtd service repeatly with high frequency(1 per second), and found that the file capabilities.pidfile is left behind, as well as a qemu process. If I then restart libvirtd, qemu-kvm will fail to start as it's unable to flock capabilities.pidfile's fd.
>

Have you tried current master?  Or at least -rc2?  It should already
be fixed there:

commit 9e159b521dbf18c6da6976e54e29c8553f831eb6
Author: Guido Günther <agx at sigxcpu.org>
Date:   Thu Sep 25 10:30:58 2014 +0200

    qemu: remove capabilities.monitor.sock when done

Martin

>
>Steps to reproduce the problem:
>1. start libvirtd service per second with a shell script.
>2. meanwhile, stop libvirtd service per second with another shell script.
>3. then, a process qemu is left behind:
>    /usr/bin/qemu-kvm -S -no-user-config -nodefaults -nographic -M none -qmp unix:/var/lib/libvirt/qemu/capabilities.monitor.sock,server,nowait -pidfile /var/lib/libvirt/qemu/capabilities.pidfile -daemonize
>4. file /var/lib/libvirt/qemu/capabilities.pidfile is left behind
>5. start libvirtd again, the process qemu-kvm fails to start.
>
>
>The cause of the problem:
>   This file is generated by qemu, and deleted by libvirtd. If libvirtd got killed before it removes the pidfile, it would be left behind then.
>
>Question:
>   Would it be fine if I kill qemu-kvm process and unlink capabilities.pidfile, just before virQEMUCapsInitQMP runs this qemu-kvm process?
>
>--
>Best Regards
>
>Wang Yufei
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140930/1b8bb3e6/attachment-0001.sig>


More information about the libvir-list mailing list