2 Commits

Author SHA1 Message Date
f99ff1400a chore: release 1.3.3 2026-09-06 11:36:25 +02:00
4e0df16271 fix: wait for domain to run before cpuid watcher reads its tap 2026-09-06 11:36:25 +02:00
3 changed files with 11 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
pkgbase = vfio-native pkgbase = vfio-native
pkgdesc = Present a libvirt guest as a self-consistent physical machine, and tune it pkgdesc = Present a libvirt guest as a self-consistent physical machine, and tune it
pkgver = 1.1.1 pkgver = 1.3.3
pkgrel = 1 pkgrel = 1
url = https://git.archworks.co/sandwich/vfio-native url = https://git.archworks.co/sandwich/vfio-native
install = vfio-native.install install = vfio-native.install
@@ -17,7 +17,7 @@ pkgbase = vfio-native
optdepends = cpupower: set the host CPU governor optdepends = cpupower: set the host CPU governor
optdepends = vfio-native-kvm-dkms: patched KVM modules for the full level optdepends = vfio-native-kvm-dkms: patched KVM modules for the full level
optdepends = vfio-native-qemu: patched QEMU for the full level optdepends = vfio-native-qemu: patched QEMU for the full level
source = git+https://git.archworks.co/sandwich/vfio-native.git#tag=v1.1.1 source = git+https://git.archworks.co/sandwich/vfio-native.git#tag=v1.3.3
sha256sums = SKIP sha256sums = SKIP
pkgname = vfio-native pkgname = vfio-native

View File

@@ -8,7 +8,7 @@
# vfio-native-qemu QEMU 11.1.1 with the platform-identity patches, in /opt # vfio-native-qemu QEMU 11.1.1 with the platform-identity patches, in /opt
pkgname=vfio-native pkgname=vfio-native
pkgver=1.3.2 pkgver=1.3.3
pkgrel=1 pkgrel=1
pkgdesc="Present a libvirt guest as a self-consistent physical machine, and tune it" pkgdesc="Present a libvirt guest as a self-consistent physical machine, and tune it"
arch=('any') arch=('any')

View File

@@ -23,9 +23,6 @@ PARAM=/sys/module/kvm_amd/parameters
V="virsh -c qemu:///system" V="virsh -c qemu:///system"
running() { [ "$($V domstate "$DOMAIN" 2>/dev/null)" = running ]; } running() { [ "$($V domstate "$DOMAIN" 2>/dev/null)" = running ]; }
tap=$($V domiflist "$DOMAIN" 2>/dev/null | awk '$1 ~ /^(vnet|tap|macvtap)/ {print $1; exit}')
RX="/sys/class/net/$tap/statistics/rx_packets"
rx() { cat "$RX" 2>/dev/null || echo 0; } rx() { cat "$RX" 2>/dev/null || echo 0; }
set_N() { echo N > "$PARAM/cpuid_passthrough"; } set_N() { echo N > "$PARAM/cpuid_passthrough"; }
@@ -46,6 +43,14 @@ wait_net_up() {
return 0 return 0
} }
# The hook arms this watcher at prepare, before QEMU starts, so the domain is not
# yet running and its tap does not exist. Wait for the domain, then read the tap;
# otherwise the first running check in wait_net_up bails and the flip never happens.
for _ in $(seq 1 120); do running && break; sleep 1; done
running || exit 0
tap=$($V domiflist "$DOMAIN" 2>/dev/null | awk '$1 ~ /^(vnet|tap|macvtap)/ {print $1; exit}')
RX="/sys/class/net/$tap/statistics/rx_packets"
# initial cold boot: wait for the network, then harden # initial cold boot: wait for the network, then harden
wait_net_up 0 wait_net_up 0
running || exit 0 running || exit 0