OH MY GOD
YOUR SCRIPT REALLY WORKS
vendor-reset only can sue once,since the vm reboot,code 43 again,dmsg with Failed to send message 0x25: return 0x0 reset amd
And i use your script with dmesg output:
[ 2456.918748] vfio-pci 0000:09:00.0: enabling device (0400 -> 0403)
[ 2456.918901] vfio-pci...