On Wed, 2023-03-29 at 21:56 +0100, Alex Bennée wrote: > Alex Bennée <alex.bennee@xxxxxxxxxx> writes: > > > From: David Woodhouse <dwmw@xxxxxxxxxxxx> > > > > Exercise guests with a few different modes for interrupt delivery. In > > particular we want to cover: > > > > • Xen event channel delivery via GSI to the I/O APIC > > • Xen event channel delivery via GSI to the i8259 PIC > > • MSIs routed to PIRQ event channels > > • GSIs routed to PIRQ event channels > > > > As well as some variants of normal non-Xen stuff like MSI to vAPIC and > > PCI INTx going to the I/O APIC and PIC, which ought to still work even > > in Xen mode. > > > > Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx> > > Signed-off-by: Alex Bennée <alex.bennee@xxxxxxxxxx> > > > > --- > > v2 (ajb) > > - switch to plain QemuSystemTest + LinuxSSHMixIn > > - switch from fedora to custom kernel and buildroot > > - removed some unused code > > TODO: > > - properly probe for host support to skip test > > So any idea for the best thing to check for here? > Hm, we don't actually translate error strings output from qemu, do we? So if we want to catch the actual qemu binary under test not having CONIG_XEN_EMU support, in *addition* to the kernel lacking the required support, how about something like... @@ -63,7 +64,16 @@ def run_and_check(self): '-device', 'virtio-net-pci,netdev=unet', '-netdev', 'user,id=unet,hostfwd=:127.0.0.1:0-:22') - self.vm.launch() + try: + self.vm.launch() + except machine.VMLaunchFailure as e: + if "Xen HVM guest support not present" in e.output: + self.cancel("KVM Xen support is not present (need v5.12+ kernel with CONFIG_KVM_XEN)") + elif "Property 'kvm-accel.xen-version' not found" in e.output: + self.cancel("QEMU not built with CONFIG_XEN_EMU support") + else: + raise e + self.log.info('VM launched, waiting for sshd') console_pattern = 'Starting dropbear sshd: OK' wait_for_console_pattern(self, console_pattern, 'Oops') If we needed to do it without matching on strings and depending on them being untranslated, can we introspect the properties of the KVM accelerator object from the command line, and see if the 'xen-version' property is available?
Attachment:
smime.p7s
Description: S/MIME cryptographic signature