diff options
| author | 2024-11-12 22:26:02 -0500 | |
|---|---|---|
| committer | 2024-11-12 22:36:49 -0500 | |
| commit | 53a0a5473f45d37027af9663638adbf56667e4ca (patch) | |
| tree | 05c6c39678a9005f95c00e0fdf31193657bd4d3d /hosts/iroha/libvirt/hooks/qemu.d/arcade/release | |
| download | dotfiles-53a0a5473f45d37027af9663638adbf56667e4ca.tar.gz dotfiles-53a0a5473f45d37027af9663638adbf56667e4ca.tar.bz2 dotfiles-53a0a5473f45d37027af9663638adbf56667e4ca.zip | |
Hopefully no leaks
Diffstat (limited to 'hosts/iroha/libvirt/hooks/qemu.d/arcade/release')
3 files changed, 32 insertions, 0 deletions
diff --git a/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/cpuset_release_common.sh b/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/cpuset_release_common.sh new file mode 120000 index 0000000..d823a60 --- /dev/null +++ b/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/cpuset_release_common.sh @@ -0,0 +1 @@ +../../../../cpuset_release_common.sh
\ No newline at end of file diff --git a/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/port_close.sh b/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/port_close.sh new file mode 100755 index 0000000..0d58fa7 --- /dev/null +++ b/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/port_close.sh @@ -0,0 +1,14 @@ +#! /usr/bin/env bash + +# kdeconnect (remove) +iptables -t nat -C PREROUTING -p tcp -s 192.168.1.0/24 --dport 1714:1764 \ + -j DNAT --to-destination 192.168.122.40:1714-1764 || \ +iptables -t nat -D PREROUTING -p tcp -s 192.168.1.0/24 --dport 1714:1764 \ + -j DNAT --to-destination 192.168.122.40:1714-1764 +iptables -t nat -C PREROUTING -p udp -s 192.168.1.0/24 --dport 1714:1764 \ + -j DNAT --to-destination 192.168.122.40:1714-1764 || \ +iptables -t nat -D PREROUTING -p udp -s 192.168.1.0/24 --dport 1714:1764 \ + -j DNAT --to-destination 192.168.122.40:1714-1764 + +iptables -C FORWARD -m state -d 192.168.122.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT || \ +iptables -D FORWARD -m state -d 192.168.122.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT diff --git a/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/unbind_vfio.sh b/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/unbind_vfio.sh new file mode 100755 index 0000000..c256d2a --- /dev/null +++ b/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/unbind_vfio.sh @@ -0,0 +1,17 @@ +#! /usr/bin/env bash + +source "/etc/libvirt/hooks/arcade.conf" + +virsh nodedev-reattach $VIRSH_GPU_VIDEO +virsh nodedev-reattach $VIRSH_GPU_AUDIO +virsh nodedev-reattach $VIRSH_NVME +virsh nodedev-reattach $VIRSH_USB + +modprobe -r vfio_pci +modprobe -r vfio_iommu_type1 +modprobe -r vfio + +modprobe nvidia-drm +modprobe nvidia-modeset +modprobe nvidia-uvm +modprobe nvidia |