Skip to contentSkip to conversation

x86/run: Specify "-vnc none" for QEMU if and only if QEMU supports VNC

PATCH Applied Sean Christopherson 1 participant 2 messages May 29, 2025 – Jun 10, 2025 KVM

lore
Share & tools
lore

Sean Christopherson

author reviewer
#0 lore raw

PATCH 1/1 x86/run: Specify "-vnc none" for QEMU if and only if QEMU supports VNC

Explicitly disable VNC when running QEMU x86 if and only if QEMU actually supports creating a VNC server, as QEMU will somewhat ironically complain about "-vnc none" being an unknown option if QEMU was built without support for VNC.

Fixes 0b8c3946 ("x86: cmpxchg8b: new 32-bit only testcase")
---
 x86/run | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
x86/run +9 -1
index a3d3e7db..bfdf365b 100755
@@ -36,7 +36,15 @@ else
 	pc_testdev="-device testdev,chardev=testlog -chardev file,id=testlog,path=msr.out"
 fi
 
-command="${qemu} --no-reboot -nodefaults $pc_testdev -vnc none -serial stdio $pci_testdev"
+if
+	${qemu} -vnc '?' 2>&1 | grep -F "vnc options" > /dev/null;
+then
+	vnc_none="-vnc none"
+else
+	vnc_none=""
+fi
+
+command="${qemu} --no-reboot -nodefaults $pc_testdev $vnc_none -serial stdio $pci_testdev"
 command+=" -machine accel=$ACCEL$ACCEL_PROPS"
 if [ "${CONFIG_EFI}" != y ]; then
 	command+=" -kernel"

base-commit: 08db0f5cfbca16b36f200b7bc54a78fa4941bcce

Signature · 1 line
2.49.0.1204.g71687c7c1d-goog
author reviewer Applied
#1 lore raw
Quoted 4 lines · Sean Christopherson

Explicitly disable VNC when running QEMU x86 if and only if QEMU actually supports creating a VNC server, as QEMU will somewhat ironically complain about "-vnc none" being an unknown option if QEMU was built without support for VNC.

Applied to kvm-x86 next, thanks!

[1/1] x86/run: Specify "-vnc none" for QEMU if and only if QEMU supports VNC

      https://github.com/kvm-x86/kvm-unit-tests/commit/0f982a8c1e22

--
https://github.com/kvm-x86/kvm-unit-tests/tree/next