I am running a virtual machine that requires vfio access to a PCI card. Using this script I am able to successfully bind the PCI device and its iommu group to vfio-pci, which then lets me boot up the VM:
./vfio-pci-bind.sh 0000:03:00.0virsh start myvm
I want to do this automatically instead of having to manually bind to vfio-pci every time. Is there some sort of preflight/preboot script I can make virsh run before it attempts to boot a vm?