We're doing some nasty things with storage (blkdevs mangling, DM, caching, etc) and would like the libvirtd availability and domain auto-starting be split into separate entities, so that we could hook into the middle. Currently, on libvirtd startup, domains marked as such are autostarted. Which means there's no way for us to either: 1) start libvirtd.service; do our work that involves using libvirt routines; start "autostarted" domains 2) do our work involving communication with libvirtd daemon (e.g. virsh domblklist) before it's started; proceed with libvirtd startup (which would start autostart'ed domains) We can't use hooks in 1) (otherwise I wouldn't log this RFE) because https://www.libvirt.org/hooks.html#recursive AND because (probably?) hook would be invoked after domains are autostart'ed. Ideas are welcome. Thanks.
Honestly if you have such complex ordering requirements wrt autostart, the best approach is to not use libvirt's autostart feature at all. Create your own system unit file that depends on libvirtd.service, and have this do startup of storage and guests in whatever manner you need.
Thanks, Daniel, that's one of the direction we're heading to. But still, this enhancement would be a good addition to https://bugzilla.redhat.com/show_bug.cgi?id=1401054 . I mean, if you have split the shutdown part, why not split the start-up.