qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: qemu-devel@nongnu.org, "Cleber Rosa" <crosa@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Beraldo Leal" <bleal@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"open list:Overall KVM CPUs" <kvm@vger.kernel.org>
Subject: Re: [EXTERNAL][RFC PATCH] tests/avocado: Test Xen guest support under KVM
Date: Mon, 03 Apr 2023 13:21:04 +0100	[thread overview]
Message-ID: <6ac97ed7d2ce3356330aab54766b54f877d2aa25.camel@infradead.org> (raw)
In-Reply-To: <87y1nfp98n.fsf@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 2462 bytes --]

On Wed, 2023-03-29 at 21:56 +0100, Alex Bennée wrote:
> Alex Bennée <alex.bennee@linaro.org> writes:
> 
> > From: David Woodhouse <dwmw@amazon.co.uk>
> > 
> > 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@amazon.co.uk>
> > Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> > 
> > ---
> > 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 #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5965 bytes --]

      reply	other threads:[~2023-04-03 12:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-24 16:07 [RFC PATCH] tests/avocado: Test Xen guest support under KVM Alex Bennée
2023-03-29 20:56 ` Alex Bennée
2023-04-03 12:21   ` David Woodhouse [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ac97ed7d2ce3356330aab54766b54f877d2aa25.camel@infradead.org \
    --to=dwmw2@infradead.org \
    --cc=alex.bennee@linaro.org \
    --cc=bleal@redhat.com \
    --cc=crosa@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wainersm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).