On 07/03/2020 10.48, Mark Cave-Ayland wrote:
> Hi all,
> 
> After a recent rebase I've started seeing iotest 267 after running "make 
> check" on
> qemu-system-sparc64. The diff output looks similar to this:
> 
> --- /home/build/src/qemu/git/qemu/tests/qemu-iotests/267.out    2020-01-22
> 17:57:54.246650995 +0000
> +++ /home/build/src/qemu/git/qemu/tests/qemu-iotests/267.out.bad        
> 2020-03-07
> 09:25:36.044451658 +0000
> @@ -41,13 +41,7 @@
>  Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
>  Testing: -drive driver=IMGFMT,file=TEST_DIR/t.IMGFMT,if=none -device
> virtio-blk,drive=none0
>  QEMU X.Y.Z monitor - type 'help' for more information
> -(qemu) savevm snap0
> -(qemu) info snapshots
> -List of snapshots present on all disks:
> -ID        TAG                 VM SIZE                DATE       VM CLOCK
> ---        snap0                  SIZE yyyy-mm-dd hh:mm:ss   00:00:00.000
> -(qemu) loadvm snap0
> -(qemu) quit
> +(qemu) QEMU_PROG: -device virtio-blk,drive=none0: PCI: no slot/function 
> available
> for virtio-blk-pci, all in use or reserved
> 
> The error message here is because the sun4u machine PCI root (default) bus 
> contains
> only 2 PCI bridges and cannot have devices plugged into it directly. An 
> example of
> how to use virtio-blk-pci on qemu-system-sparc64 is shown at
> https://wiki.qemu.org/Documentation/Platforms/SPARC#All_PCI_devices_are_attached_behind_one_of_the_simba_PCI_bridges.
> 
> It seems that all that is missing is a way to specify the bus= parameter for 
> the
> virtio-blk-pci device for this test to work. Can anyone suggest a suitable 
> way to do
> this?

 Hi!

Sorry for the late reply... but better late than never:

I think you likely don't want to change each and every current and
future iotest to contain a "bus=..." parameter - that's not reasonable.
So I see two possibilities to get "make check" working here again:

1) From a user point of view, it would be great if PCI devices could be
used on the sun4u machine also without specifying the "bus=..."
property. Is there a way to convince QEMU to plug PCI devices in a
different bus with free slots in case the root bus is already full? ...
I had a quick look at the sources, but unfortunately I failed to spot
the code that decides which PCI bus should be used in case no "bus=..."
property has been specified, so no clue whether this is feasible or not.

2) Simply change the _require_devices function in
tests/qemu-iotests/common.rc to filter out the virtio and pci devices on
sparc64. Something like this should do the job, I hope:

diff a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -788,6 +788,11 @@ _require_devices()
 {
     available=$($QEMU -M none -device help | \
                 grep ^name | sed -e 's/^name "//' -e 's/".*$//')
+    case "$QEMU_PROG" in
+        *qemu-system-sparc64)
+            available=$(grep -v -i -E 'pci|virtio' <<< $available)
+            ;;
+    esac
     for device
     do
         if ! echo "$available" | grep -q "$device" ; then

 HTH,
  Thomas


Reply via email to