[libvirt-users] Attaching a hostdev on startup

Mat Arge argemat1010 at gmail.com
Fri Mar 7 12:45:51 UTC 2014


Hello!

I have written a script which attaches some USB tokens as hostdev devices
to (qemu) VMs managed by libvirt. This works fine as long as I call the
script manually.
But what I really want to do, is run this scrip from a startup hook, so
that whenever a Vm is started, it looks if there are appopriate tokens
available for attachment. But when the script is run from the hook, it
(along with the whole libvirtd) freezes. That doesn't really come as a
surprise, since http://libvirt.org/hooks.html explicitely states

A hook script must not call back into libvirt, as the libvirt daemon is
already waiting for the script to exit.

A deadlock is likely to occur.


How can I get around this problem?


cheers

Mat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20140307/0397d619/attachment.htm>


More information about the libvirt-users mailing list