Hi,
I'm particularly interested in the PoC of KubeVirt to allow
custom changes in libvirt domain xml in a more straightforward
manner than they have Today [0].
When I was looking into the libvirt hooks, I was a bit excited
when I read:
you can also place several hook scripts in the directory
/etc/libvirt/hooks/qemu.d/. They are executed in alphabetical
order after main script. In this case each script also acts as
filter and can modify the domain XML and print it out on its
standard output. This script output is passed to standard
input next script in order. Empty output from any script is
also identical to copying the input XML without changing it.
In case any script returns failure common process will be
aborted, but all scripts from the directory will are executed.
But that's not the case for every situation. When the domain is
being defined the scripts are run but the output is ignored [1]
Is there a reason for that?
In KubeVirt we basically have to re-implement [2] what the logic
around scripts under qemu.d already does. If we could use libvirt
only it would make testing easier for users and less code on
KubeVirt.
[0]
https://kubevirt.io/user-guide/user_workloads/hook-sidecar/
[1]
https://gitlab.com/libvirt/libvirt/-/blob/master/src/qemu/qemu_process.c#...
[2]
https://github.com/kubevirt/kubevirt/blob/main/pkg/hooks/manager.go#L200
Cheers,
Victor