[libvirt-users] libvirt prepare and start hooks not callled

Jiri Denemark jdenemar at redhat.com
Mon Nov 16 12:27:03 UTC 2015


On Fri, Nov 13, 2015 at 20:44:15 +0000, Sundar Nadathur wrote:
>    I am using RHEL 7.1 and libvirt 1.2.8. My intention is to intercept
>    the prepare and start hooks of libvirt during VM placement to
>    inject a virtio PCI device into the VM's domain xml.

You are not supposed to talk to libvirtd from any hooks.

> I placed a python script with execute permissions in
> /etc/libvirt/hooks/qemu. In there, I opened a log file to record the
> arguments received:
> log.write("avfd called with args: %s\n" % sys.argv)
> But all I get in the log file is:
> avfd called with args: ['/etc/libvirt/hooks/qemu', 'vm1', 'started', 'begin', '-']
> There are no prepare or start calls. Can somebody explain what it takes to fix this?

If you're trying to update the domain's configuration from the hook,
you caused a deadlock between libvirt and your hook. Thus your hook
script will never finish and libvirtd will be waiting for the hook to
finish and it will never start the domain.


More information about the libvirt-users mailing list