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