<div dir="ltr"><div><div>Hello!<br><br></div>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.<br></div>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 <a href="http://libvirt.org/hooks.html">http://libvirt.org/hooks.html</a> explicitely states <br>
<p>A hook script must not call back into libvirt, as the libvirt daemon
       is already waiting for the script to exit.</p><p>A deadlock is likely to occur.</p><p><br></p><p>How can I get around this problem?</p><p><br></p><p>cheers</p><p>Mat<br></p></div>