single-gpu-passthrough/hooks/qemu

21 lines
594 B
Plaintext
Raw Normal View History

2020-10-13 02:07:46 +00:00
#!/bin/bash
OBJECT="$1"
OPERATION="$2"
if [[ $OBJECT == "win10" ]]; then
case "$OPERATION" in
"prepare")
systemctl start libvirt-nosleep@"$OBJECT" 2>&1 | tee -a /var/log/libvirt/custom_hooks.log
/usr/local/bin/vfio-startup 2>&1 | tee -a /var/log/libvirt/custom_hooks.log
2020-10-13 02:07:46 +00:00
;;
"release")
systemctl stop libvirt-nosleep@"$OBJECT" 2>&1 | tee -a /var/log/libvirt/custom_hooks.log
/usr/local/bin/vfio-teardown 2>&1 | tee -a /var/log/libvirt/custom_hooks.log
2020-10-13 02:07:46 +00:00
;;
esac
fi