diff mbox series

[4/4] iotests: iothreads need ioeventfd

Message ID 20210318223907.1344870-5-laurent@vivier.eu (mailing list archive)
State New, archived
Headers show
Series iotests: fix failures with non-PCI machines | expand

Commit Message

Laurent Vivier March 18, 2021, 10:39 p.m. UTC
And ioeventfd are only available with virtio-scsi-pci, so don't use the alias
and add a rule to require virtio-scsi-pci for the tests that use iothreads.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 tests/qemu-iotests/127        | 4 ++--
 tests/qemu-iotests/256        | 2 ++
 tests/qemu-iotests/iotests.py | 5 +++++
 3 files changed, 9 insertions(+), 2 deletions(-)

Comments

Paolo Bonzini March 19, 2021, 11:06 a.m. UTC | #1
On 18/03/21 23:39, Laurent Vivier wrote:
> And ioeventfd are only available with virtio-scsi-pci, so don't use the alias
> and add a rule to require virtio-scsi-pci for the tests that use iothreads.
> 
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>   tests/qemu-iotests/127        | 4 ++--
>   tests/qemu-iotests/256        | 2 ++
>   tests/qemu-iotests/iotests.py | 5 +++++
>   3 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/qemu-iotests/127 b/tests/qemu-iotests/127
> index 98e8e82a8210..a3693533685a 100755
> --- a/tests/qemu-iotests/127
> +++ b/tests/qemu-iotests/127
> @@ -44,7 +44,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
>   _supported_fmt qcow2
>   _supported_proto file fuse
>   
> -_require_devices virtio-scsi scsi-hd
> +_require_devices virtio-scsi-pci scsi-hd

Maybe

_require_devices scsi-hd
_require_devices virtio-scsi-pci || _require_devices virtio-scsi ccw

?

Paolo
Cornelia Huck March 19, 2021, 11:27 a.m. UTC | #2
On Fri, 19 Mar 2021 12:06:43 +0100
Paolo Bonzini <pbonzini@redhat.com> wrote:

> On 18/03/21 23:39, Laurent Vivier wrote:
> > And ioeventfd are only available with virtio-scsi-pci, so don't use the alias
> > and add a rule to require virtio-scsi-pci for the tests that use iothreads.
> > 
> > Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> > ---
> >   tests/qemu-iotests/127        | 4 ++--
> >   tests/qemu-iotests/256        | 2 ++
> >   tests/qemu-iotests/iotests.py | 5 +++++
> >   3 files changed, 9 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tests/qemu-iotests/127 b/tests/qemu-iotests/127
> > index 98e8e82a8210..a3693533685a 100755
> > --- a/tests/qemu-iotests/127
> > +++ b/tests/qemu-iotests/127
> > @@ -44,7 +44,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
> >   _supported_fmt qcow2
> >   _supported_proto file fuse
> >   
> > -_require_devices virtio-scsi scsi-hd
> > +_require_devices virtio-scsi-pci scsi-hd  
> 
> Maybe
> 
> _require_devices scsi-hd
> _require_devices virtio-scsi-pci || _require_devices virtio-scsi ccw
> 
> ?
> 
> Paolo
> 

Yes, ioeventfds are also available for ccw; I'd expect only mmio to be
the problem here.
Laurent Vivier March 19, 2021, 11:28 a.m. UTC | #3
Le 19/03/2021 à 12:27, Cornelia Huck a écrit :
> On Fri, 19 Mar 2021 12:06:43 +0100
> Paolo Bonzini <pbonzini@redhat.com> wrote:
> 
>> On 18/03/21 23:39, Laurent Vivier wrote:
>>> And ioeventfd are only available with virtio-scsi-pci, so don't use the alias
>>> and add a rule to require virtio-scsi-pci for the tests that use iothreads.
>>>
>>> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
>>> ---
>>>   tests/qemu-iotests/127        | 4 ++--
>>>   tests/qemu-iotests/256        | 2 ++
>>>   tests/qemu-iotests/iotests.py | 5 +++++
>>>   3 files changed, 9 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/tests/qemu-iotests/127 b/tests/qemu-iotests/127
>>> index 98e8e82a8210..a3693533685a 100755
>>> --- a/tests/qemu-iotests/127
>>> +++ b/tests/qemu-iotests/127
>>> @@ -44,7 +44,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
>>>   _supported_fmt qcow2
>>>   _supported_proto file fuse
>>>   
>>> -_require_devices virtio-scsi scsi-hd
>>> +_require_devices virtio-scsi-pci scsi-hd  
>>
>> Maybe
>>
>> _require_devices scsi-hd
>> _require_devices virtio-scsi-pci || _require_devices virtio-scsi ccw
>>
>> ?
>>
>> Paolo
>>
> 
> Yes, ioeventfds are also available for ccw; I'd expect only mmio to be
> the problem here.
> 

OK, thanks.

I update my patch with the changes from Paolo.

Laurent
diff mbox series

Patch

diff --git a/tests/qemu-iotests/127 b/tests/qemu-iotests/127
index 98e8e82a8210..a3693533685a 100755
--- a/tests/qemu-iotests/127
+++ b/tests/qemu-iotests/127
@@ -44,7 +44,7 @@  trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow2
 _supported_proto file fuse
 
-_require_devices virtio-scsi scsi-hd
+_require_devices virtio-scsi-pci scsi-hd
 
 IMG_SIZE=64K
 
@@ -62,7 +62,7 @@  $QEMU_IO -c 'write 0 42' "$TEST_IMG.overlay0" | _filter_qemu_io
 _launch_qemu \
     -object iothread,id=iothr \
     -blockdev node-name=source,driver=$IMGFMT,file.driver=file,file.filename="$TEST_IMG.overlay0" \
-    -device virtio-scsi,id=scsi-bus,iothread=iothr \
+    -device virtio-scsi-pci,id=scsi-bus,iothread=iothr \
     -device scsi-hd,bus=scsi-bus.0,drive=source
 
 _send_qemu_cmd $QEMU_HANDLE \
diff --git a/tests/qemu-iotests/256 b/tests/qemu-iotests/256
index 8d82a1dd865f..eb3af0dea80c 100755
--- a/tests/qemu-iotests/256
+++ b/tests/qemu-iotests/256
@@ -24,6 +24,8 @@  import os
 import iotests
 from iotests import log
 
+iotests._verify_virtio_scsi_pci()
+
 iotests.script_initialize(supported_fmts=['qcow2'])
 size = 64 * 1024 * 1024
 
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 1e9e6a066e90..3404ed534bb5 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -1146,6 +1146,11 @@  def _verify_virtio_blk() -> None:
     if 'virtio-blk' not in out:
         notrun('Missing virtio-blk in QEMU binary')
 
+def _verify_virtio_scsi_pci() -> None:
+    out = qemu_pipe('-M', 'none', '-device', 'help')
+    if 'virtio-scsi-pci' not in out:
+        notrun('Missing virtio-scsi-pci in QEMU binary')
+
 
 def supports_quorum():
     return 'quorum' in qemu_img_pipe('--help')