All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/3] iotests: cure s390x failures by switching to ccw/aliases
@ 2017-09-13  9:10 Cornelia Huck
  2017-09-13  9:10 ` [Qemu-devel] [PATCH v2 1/3] iotests: use -ccw on s390x for 040, 139, and 182 Cornelia Huck
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Cornelia Huck @ 2017-09-13  9:10 UTC (permalink / raw)
  To: kwolf, mreitz
  Cc: qemu-block, qemu-devel, borntraeger, agraf, thuth, david, haoqf,
	Cornelia Huck

Recent changes in s390x made pci support dependant on the zpci cpu
feature, which is not provided on all models (and not on by default).
This means we cannot instatiate pci devices on a standard qemu
invocation for s390x. Moreover, the zpci instructions are not even
wired up for tcg yet, so actually doing anything with those pci devices
is bound to fail on tcg.

For 040, 051, 139, and 182, this can be fixed by switching to virtio-ccw
from virtio-pci on s390x. 051 also needs a bit of post-processing on
the output.

For 067, it is easier to switch to virtio aliases, which will pick
virtio-ccw on s390x and virtio-pci elsewhere. It also exercises the
aliasing path.

v1->v2:
- avoid adding new reference output by adding post-processing to 051
  and switching to aliases for 067

Cornelia Huck (3):
  iotests: use -ccw on s390x for 040, 139, and 182
  iotests: use -ccw on s390x for 051
  iotests: use virtio aliases for 067

 tests/qemu-iotests/040        |  6 +++++-
 tests/qemu-iotests/051        | 12 +++++++++++-
 tests/qemu-iotests/051.out    |  2 +-
 tests/qemu-iotests/051.pc.out |  2 +-
 tests/qemu-iotests/067        |  3 ++-
 tests/qemu-iotests/067.out    |  2 +-
 tests/qemu-iotests/139        | 12 ++++++++++--
 tests/qemu-iotests/182        | 13 +++++++++++--
 8 files changed, 42 insertions(+), 10 deletions(-)

-- 
2.13.5

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH v2 1/3] iotests: use -ccw on s390x for 040, 139, and 182
  2017-09-13  9:10 [Qemu-devel] [PATCH v2 0/3] iotests: cure s390x failures by switching to ccw/aliases Cornelia Huck
@ 2017-09-13  9:10 ` Cornelia Huck
  2017-09-13 11:59   ` David Hildenbrand
  2017-09-13  9:10 ` [Qemu-devel] [PATCH v2 2/3] iotests: use -ccw on s390x for 051 Cornelia Huck
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Cornelia Huck @ 2017-09-13  9:10 UTC (permalink / raw)
  To: kwolf, mreitz
  Cc: qemu-block, qemu-devel, borntraeger, agraf, thuth, david, haoqf,
	Cornelia Huck

The default cpu model on s390x does not provide zPCI, which is
not yet wired up on tcg. Moreover, virtio-ccw is the standard
on s390x, so use the -ccw instead of the -pci versions of virtio
devices on s390x.

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 tests/qemu-iotests/040 |  6 +++++-
 tests/qemu-iotests/139 | 12 ++++++++++--
 tests/qemu-iotests/182 | 13 +++++++++++--
 3 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040
index 95b7510571..c284d08796 100755
--- a/tests/qemu-iotests/040
+++ b/tests/qemu-iotests/040
@@ -82,7 +82,11 @@ class TestSingleDrive(ImageCommitTestCase):
         qemu_io('-f', 'raw', '-c', 'write -P 0xab 0 524288', backing_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 524288', mid_img)
         self.vm = iotests.VM().add_drive(test_img, "node-name=top,backing.node-name=mid,backing.backing.node-name=base", interface="none")
-        self.vm.add_device("virtio-scsi-pci")
+        if iotests.qemu_default_machine == 's390-ccw-virtio':
+            self.vm.add_device("virtio-scsi-ccw")
+        else:
+            self.vm.add_device("virtio-scsi-pci")
+
         self.vm.add_device("scsi-hd,id=scsi0,drive=drive0")
         self.vm.launch()
 
diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139
index 50cf40fbd5..f8f02808a9 100644
--- a/tests/qemu-iotests/139
+++ b/tests/qemu-iotests/139
@@ -25,13 +25,21 @@ import time
 
 base_img = os.path.join(iotests.test_dir, 'base.img')
 new_img = os.path.join(iotests.test_dir, 'new.img')
+if iotests.qemu_default_machine == 's390-ccw-virtio':
+    default_virtio_blk = 'virtio-blk-ccw'
+else:
+    default_virtio_blk = 'virtio-blk-pci'
 
 class TestBlockdevDel(iotests.QMPTestCase):
 
     def setUp(self):
         iotests.qemu_img('create', '-f', iotests.imgfmt, base_img, '1M')
         self.vm = iotests.VM()
-        self.vm.add_device("virtio-scsi-pci,id=virtio-scsi")
+        if iotests.qemu_default_machine == 's390-ccw-virtio':
+            self.vm.add_device("virtio-scsi-ccw,id=virtio-scsi")
+        else:
+            self.vm.add_device("virtio-scsi-pci,id=virtio-scsi")
+
         self.vm.launch()
 
     def tearDown(self):
@@ -87,7 +95,7 @@ class TestBlockdevDel(iotests.QMPTestCase):
         self.checkBlockDriverState(node, expect_error)
 
     # Add a device model
-    def addDeviceModel(self, device, backend, driver = 'virtio-blk-pci'):
+    def addDeviceModel(self, device, backend, driver = default_virtio_blk):
         result = self.vm.qmp('device_add', id = device,
                              driver = driver, drive = backend)
         self.assert_qmp(result, 'return', {})
diff --git a/tests/qemu-iotests/182 b/tests/qemu-iotests/182
index 7ecbb22604..2e078ceed8 100755
--- a/tests/qemu-iotests/182
+++ b/tests/qemu-iotests/182
@@ -45,17 +45,26 @@ _supported_os Linux
 
 size=32M
 
+case "$QEMU_DEFAULT_MACHINE" in
+  s390-ccw-virtio)
+      virtioblk=virtio-blk-ccw
+      ;;
+  *)
+      virtioblk=virtio-blk-pci
+      ;;
+esac
+
 _make_test_img $size
 
 echo "Starting QEMU"
 _launch_qemu -drive file=$TEST_IMG,if=none,id=drive0,file.locking=on \
-    -device virtio-blk-pci,drive=drive0
+    -device $virtioblk,drive=drive0
 
 echo
 echo "Starting a second QEMU using the same image should fail"
 echo 'quit' | $QEMU -monitor stdio \
     -drive file=$TEST_IMG,if=none,id=drive0,file.locking=on \
-    -device virtio-blk-pci,drive=drive0 2>&1 | _filter_testdir 2>&1 |
+    -device $virtioblk,drive=drive0 2>&1 | _filter_testdir 2>&1 |
     _filter_qemu |
     sed -e '/falling back to POSIX file/d' \
         -e '/locks can be lost unexpectedly/d'
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH v2 2/3] iotests: use -ccw on s390x for 051
  2017-09-13  9:10 [Qemu-devel] [PATCH v2 0/3] iotests: cure s390x failures by switching to ccw/aliases Cornelia Huck
  2017-09-13  9:10 ` [Qemu-devel] [PATCH v2 1/3] iotests: use -ccw on s390x for 040, 139, and 182 Cornelia Huck
@ 2017-09-13  9:10 ` Cornelia Huck
  2017-09-13  9:18   ` Thomas Huth
  2017-09-13 11:57   ` David Hildenbrand
  2017-09-13  9:10 ` [Qemu-devel] [PATCH v2 3/3] iotests: use virtio aliases for 067 Cornelia Huck
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 11+ messages in thread
From: Cornelia Huck @ 2017-09-13  9:10 UTC (permalink / raw)
  To: kwolf, mreitz
  Cc: qemu-block, qemu-devel, borntraeger, agraf, thuth, david, haoqf,
	Cornelia Huck

The default cpu model on s390x does not provide zPCI, which is
not yet wired up on tcg. Moreover, virtio-ccw is the standard
on s390x, so use the -ccw instead of the -pci versions of virtio
devices on s390x.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 tests/qemu-iotests/051        | 12 +++++++++++-
 tests/qemu-iotests/051.out    |  2 +-
 tests/qemu-iotests/051.pc.out |  2 +-
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index c8cfc764bc..dba8816c9f 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -103,7 +103,17 @@ echo
 echo === Device without drive ===
 echo
 
-run_qemu -device virtio-scsi-pci -device scsi-hd
+case "$QEMU_DEFAULT_MACHINE" in
+  s390-ccw-virtio)
+      virtio_scsi=virtio-scsi-ccw
+      ;;
+  *)
+      virtio_scsi=virtio-scsi-pci
+      ;;
+esac
+
+run_qemu -device $virtio_scsi -device scsi-hd |
+    sed -e "s/$virtio_scsi/VIRTIO_SCSI/"
 
 echo
 echo === Overriding backing file ===
diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out
index 4d3b1ff316..e3c6eaba57 100644
--- a/tests/qemu-iotests/051.out
+++ b/tests/qemu-iotests/051.out
@@ -49,7 +49,7 @@ QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2: Cannot specif
 
 === Device without drive ===
 
-Testing: -device virtio-scsi-pci -device scsi-hd
+Testing: -device VIRTIO_SCSI -device scsi-hd
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) QEMU_PROG: -device scsi-hd: drive property not set
 
diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out
index 76d7205460..ae7801b44b 100644
--- a/tests/qemu-iotests/051.pc.out
+++ b/tests/qemu-iotests/051.pc.out
@@ -49,7 +49,7 @@ QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2: Cannot specif
 
 === Device without drive ===
 
-Testing: -device virtio-scsi-pci -device scsi-hd
+Testing: -device VIRTIO_SCSI -device scsi-hd
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) QEMU_PROG: -device scsi-hd: drive property not set
 
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH v2 3/3] iotests: use virtio aliases for 067
  2017-09-13  9:10 [Qemu-devel] [PATCH v2 0/3] iotests: cure s390x failures by switching to ccw/aliases Cornelia Huck
  2017-09-13  9:10 ` [Qemu-devel] [PATCH v2 1/3] iotests: use -ccw on s390x for 040, 139, and 182 Cornelia Huck
  2017-09-13  9:10 ` [Qemu-devel] [PATCH v2 2/3] iotests: use -ccw on s390x for 051 Cornelia Huck
@ 2017-09-13  9:10 ` Cornelia Huck
  2017-09-13  9:17   ` Thomas Huth
  2017-09-13 12:02   ` David Hildenbrand
  2017-09-15  7:04 ` [Qemu-devel] [PATCH v2 0/3] iotests: cure s390x failures by switching to ccw/aliases QingFeng Hao
  2017-09-15 12:11 ` Kevin Wolf
  4 siblings, 2 replies; 11+ messages in thread
From: Cornelia Huck @ 2017-09-13  9:10 UTC (permalink / raw)
  To: kwolf, mreitz
  Cc: qemu-block, qemu-devel, borntraeger, agraf, thuth, david, haoqf,
	Cornelia Huck

The default cpu model on s390x does not provide zPCI, which is
not yet wired up on tcg. Moreover, virtio-ccw is the standard
on s390x.

Using virtio-scsi will implicitly pick the right device, so just
switch to that for simplicity.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 tests/qemu-iotests/067     | 3 ++-
 tests/qemu-iotests/067.out | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/067 b/tests/qemu-iotests/067
index 5d4ca4bc61..cbb3da286a 100755
--- a/tests/qemu-iotests/067
+++ b/tests/qemu-iotests/067
@@ -141,7 +141,7 @@ echo
 echo === Empty drive with -device and device_del ===
 echo
 
-run_qemu -device virtio-scsi-pci -device scsi-cd,id=cd0 <<EOF
+run_qemu -device virtio-scsi -device scsi-cd,id=cd0 <<EOF
 { "execute": "qmp_capabilities" }
 { "execute": "query-block" }
 { "execute": "device_del", "arguments": { "id": "cd0" } }
@@ -150,6 +150,7 @@ run_qemu -device virtio-scsi-pci -device scsi-cd,id=cd0 <<EOF
 { "execute": "quit" }
 EOF
 
+
 # success, all done
 echo "*** done"
 rm -f $seq.full
diff --git a/tests/qemu-iotests/067.out b/tests/qemu-iotests/067.out
index bd70557ddc..58e83c4505 100644
--- a/tests/qemu-iotests/067.out
+++ b/tests/qemu-iotests/067.out
@@ -419,7 +419,7 @@ Testing:
 
 === Empty drive with -device and device_del ===
 
-Testing: -device virtio-scsi-pci -device scsi-cd,id=cd0
+Testing: -device virtio-scsi -device scsi-cd,id=cd0
 {
     QMP_VERSION
 }
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2 3/3] iotests: use virtio aliases for 067
  2017-09-13  9:10 ` [Qemu-devel] [PATCH v2 3/3] iotests: use virtio aliases for 067 Cornelia Huck
@ 2017-09-13  9:17   ` Thomas Huth
  2017-09-13 12:02   ` David Hildenbrand
  1 sibling, 0 replies; 11+ messages in thread
From: Thomas Huth @ 2017-09-13  9:17 UTC (permalink / raw)
  To: Cornelia Huck, kwolf, mreitz
  Cc: qemu-block, qemu-devel, borntraeger, agraf, david, haoqf

On 13.09.2017 11:10, Cornelia Huck wrote:
> The default cpu model on s390x does not provide zPCI, which is
> not yet wired up on tcg. Moreover, virtio-ccw is the standard
> on s390x.
> 
> Using virtio-scsi will implicitly pick the right device, so just
> switch to that for simplicity.
> 
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>  tests/qemu-iotests/067     | 3 ++-
>  tests/qemu-iotests/067.out | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/qemu-iotests/067 b/tests/qemu-iotests/067
> index 5d4ca4bc61..cbb3da286a 100755
> --- a/tests/qemu-iotests/067
> +++ b/tests/qemu-iotests/067
> @@ -141,7 +141,7 @@ echo
>  echo === Empty drive with -device and device_del ===
>  echo
>  
> -run_qemu -device virtio-scsi-pci -device scsi-cd,id=cd0 <<EOF
> +run_qemu -device virtio-scsi -device scsi-cd,id=cd0 <<EOF
>  { "execute": "qmp_capabilities" }
>  { "execute": "query-block" }
>  { "execute": "device_del", "arguments": { "id": "cd0" } }
> @@ -150,6 +150,7 @@ run_qemu -device virtio-scsi-pci -device scsi-cd,id=cd0 <<EOF
>  { "execute": "quit" }
>  EOF
>  
> +

Superfluous white space change?

With that nit removed:

Reviewed-by: Thomas Huth <thuth@redhat.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/3] iotests: use -ccw on s390x for 051
  2017-09-13  9:10 ` [Qemu-devel] [PATCH v2 2/3] iotests: use -ccw on s390x for 051 Cornelia Huck
@ 2017-09-13  9:18   ` Thomas Huth
  2017-09-13 11:57   ` David Hildenbrand
  1 sibling, 0 replies; 11+ messages in thread
From: Thomas Huth @ 2017-09-13  9:18 UTC (permalink / raw)
  To: Cornelia Huck, kwolf, mreitz
  Cc: qemu-block, qemu-devel, borntraeger, agraf, david, haoqf

On 13.09.2017 11:10, Cornelia Huck wrote:
> The default cpu model on s390x does not provide zPCI, which is
> not yet wired up on tcg. Moreover, virtio-ccw is the standard
> on s390x, so use the -ccw instead of the -pci versions of virtio
> devices on s390x.
> 
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>  tests/qemu-iotests/051        | 12 +++++++++++-
>  tests/qemu-iotests/051.out    |  2 +-
>  tests/qemu-iotests/051.pc.out |  2 +-
>  3 files changed, 13 insertions(+), 3 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/3] iotests: use -ccw on s390x for 051
  2017-09-13  9:10 ` [Qemu-devel] [PATCH v2 2/3] iotests: use -ccw on s390x for 051 Cornelia Huck
  2017-09-13  9:18   ` Thomas Huth
@ 2017-09-13 11:57   ` David Hildenbrand
  1 sibling, 0 replies; 11+ messages in thread
From: David Hildenbrand @ 2017-09-13 11:57 UTC (permalink / raw)
  To: Cornelia Huck, kwolf, mreitz
  Cc: qemu-block, qemu-devel, borntraeger, agraf, thuth, haoqf

On 13.09.2017 11:10, Cornelia Huck wrote:
> The default cpu model on s390x does not provide zPCI, which is
> not yet wired up on tcg. Moreover, virtio-ccw is the standard
> on s390x, so use the -ccw instead of the -pci versions of virtio
> devices on s390x.
> 
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>  tests/qemu-iotests/051        | 12 +++++++++++-
>  tests/qemu-iotests/051.out    |  2 +-
>  tests/qemu-iotests/051.pc.out |  2 +-
>  3 files changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
> index c8cfc764bc..dba8816c9f 100755
> --- a/tests/qemu-iotests/051
> +++ b/tests/qemu-iotests/051
> @@ -103,7 +103,17 @@ echo
>  echo === Device without drive ===
>  echo
>  
> -run_qemu -device virtio-scsi-pci -device scsi-hd
> +case "$QEMU_DEFAULT_MACHINE" in
> +  s390-ccw-virtio)
> +      virtio_scsi=virtio-scsi-ccw
> +      ;;
> +  *)
> +      virtio_scsi=virtio-scsi-pci
> +      ;;
> +esac
> +
> +run_qemu -device $virtio_scsi -device scsi-hd |
> +    sed -e "s/$virtio_scsi/VIRTIO_SCSI/"
>  
>  echo
>  echo === Overriding backing file ===
> diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out
> index 4d3b1ff316..e3c6eaba57 100644
> --- a/tests/qemu-iotests/051.out
> +++ b/tests/qemu-iotests/051.out
> @@ -49,7 +49,7 @@ QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2: Cannot specif
>  
>  === Device without drive ===
>  
> -Testing: -device virtio-scsi-pci -device scsi-hd
> +Testing: -device VIRTIO_SCSI -device scsi-hd
>  QEMU X.Y.Z monitor - type 'help' for more information
>  (qemu) QEMU_PROG: -device scsi-hd: drive property not set
>  
> diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out
> index 76d7205460..ae7801b44b 100644
> --- a/tests/qemu-iotests/051.pc.out
> +++ b/tests/qemu-iotests/051.pc.out
> @@ -49,7 +49,7 @@ QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2: Cannot specif
>  
>  === Device without drive ===
>  
> -Testing: -device virtio-scsi-pci -device scsi-hd
> +Testing: -device VIRTIO_SCSI -device scsi-hd
>  QEMU X.Y.Z monitor - type 'help' for more information
>  (qemu) QEMU_PROG: -device scsi-hd: drive property not set
>  
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 

Thanks,

David

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2 1/3] iotests: use -ccw on s390x for 040, 139, and 182
  2017-09-13  9:10 ` [Qemu-devel] [PATCH v2 1/3] iotests: use -ccw on s390x for 040, 139, and 182 Cornelia Huck
@ 2017-09-13 11:59   ` David Hildenbrand
  0 siblings, 0 replies; 11+ messages in thread
From: David Hildenbrand @ 2017-09-13 11:59 UTC (permalink / raw)
  To: Cornelia Huck, kwolf, mreitz
  Cc: qemu-block, qemu-devel, borntraeger, agraf, thuth, haoqf

On 13.09.2017 11:10, Cornelia Huck wrote:
> The default cpu model on s390x does not provide zPCI, which is
> not yet wired up on tcg. Moreover, virtio-ccw is the standard
> on s390x, so use the -ccw instead of the -pci versions of virtio
> devices on s390x.
> 
> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>  tests/qemu-iotests/040 |  6 +++++-
>  tests/qemu-iotests/139 | 12 ++++++++++--
>  tests/qemu-iotests/182 | 13 +++++++++++--
>  3 files changed, 26 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040
> index 95b7510571..c284d08796 100755
> --- a/tests/qemu-iotests/040
> +++ b/tests/qemu-iotests/040
> @@ -82,7 +82,11 @@ class TestSingleDrive(ImageCommitTestCase):
>          qemu_io('-f', 'raw', '-c', 'write -P 0xab 0 524288', backing_img)
>          qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 524288', mid_img)
>          self.vm = iotests.VM().add_drive(test_img, "node-name=top,backing.node-name=mid,backing.backing.node-name=base", interface="none")
> -        self.vm.add_device("virtio-scsi-pci")
> +        if iotests.qemu_default_machine == 's390-ccw-virtio':
> +            self.vm.add_device("virtio-scsi-ccw")
> +        else:
> +            self.vm.add_device("virtio-scsi-pci")
> +
>          self.vm.add_device("scsi-hd,id=scsi0,drive=drive0")
>          self.vm.launch()
>  
> diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139
> index 50cf40fbd5..f8f02808a9 100644
> --- a/tests/qemu-iotests/139
> +++ b/tests/qemu-iotests/139
> @@ -25,13 +25,21 @@ import time
>  
>  base_img = os.path.join(iotests.test_dir, 'base.img')
>  new_img = os.path.join(iotests.test_dir, 'new.img')
> +if iotests.qemu_default_machine == 's390-ccw-virtio':
> +    default_virtio_blk = 'virtio-blk-ccw'
> +else:
> +    default_virtio_blk = 'virtio-blk-pci'

simply "virtio_blk" ?

>  
>  class TestBlockdevDel(iotests.QMPTestCase):
>  
>      def setUp(self):
>          iotests.qemu_img('create', '-f', iotests.imgfmt, base_img, '1M')
>          self.vm = iotests.VM()
> -        self.vm.add_device("virtio-scsi-pci,id=virtio-scsi")
> +        if iotests.qemu_default_machine == 's390-ccw-virtio':
> +            self.vm.add_device("virtio-scsi-ccw,id=virtio-scsi")
> +        else:
> +            self.vm.add_device("virtio-scsi-pci,id=virtio-scsi")
> +
>          self.vm.launch()
>  
>      def tearDown(self):
> @@ -87,7 +95,7 @@ class TestBlockdevDel(iotests.QMPTestCase):
>          self.checkBlockDriverState(node, expect_error)
>  
>      # Add a device model
> -    def addDeviceModel(self, device, backend, driver = 'virtio-blk-pci'):
> +    def addDeviceModel(self, device, backend, driver = default_virtio_blk):
>          result = self.vm.qmp('device_add', id = device,
>                               driver = driver, drive = backend)
>          self.assert_qmp(result, 'return', {})
> diff --git a/tests/qemu-iotests/182 b/tests/qemu-iotests/182
> index 7ecbb22604..2e078ceed8 100755
> --- a/tests/qemu-iotests/182
> +++ b/tests/qemu-iotests/182
> @@ -45,17 +45,26 @@ _supported_os Linux
>  
>  size=32M
>  
> +case "$QEMU_DEFAULT_MACHINE" in
> +  s390-ccw-virtio)
> +      virtioblk=virtio-blk-ccw
> +      ;;
> +  *)
> +      virtioblk=virtio-blk-pci

s/virtioblk/virtio_blk/ ?

(due to "virtio_scsi" in next patch)

> +      ;;
> +esac
> +
>  _make_test_img $size
>  
>  echo "Starting QEMU"
>  _launch_qemu -drive file=$TEST_IMG,if=none,id=drive0,file.locking=on \
> -    -device virtio-blk-pci,drive=drive0
> +    -device $virtioblk,drive=drive0
>  
>  echo
>  echo "Starting a second QEMU using the same image should fail"
>  echo 'quit' | $QEMU -monitor stdio \
>      -drive file=$TEST_IMG,if=none,id=drive0,file.locking=on \
> -    -device virtio-blk-pci,drive=drive0 2>&1 | _filter_testdir 2>&1 |
> +    -device $virtioblk,drive=drive0 2>&1 | _filter_testdir 2>&1 |
>      _filter_qemu |
>      sed -e '/falling back to POSIX file/d' \
>          -e '/locks can be lost unexpectedly/d'
> 


-- 

Thanks,

David

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2 3/3] iotests: use virtio aliases for 067
  2017-09-13  9:10 ` [Qemu-devel] [PATCH v2 3/3] iotests: use virtio aliases for 067 Cornelia Huck
  2017-09-13  9:17   ` Thomas Huth
@ 2017-09-13 12:02   ` David Hildenbrand
  1 sibling, 0 replies; 11+ messages in thread
From: David Hildenbrand @ 2017-09-13 12:02 UTC (permalink / raw)
  To: Cornelia Huck, kwolf, mreitz
  Cc: qemu-block, qemu-devel, borntraeger, agraf, thuth, haoqf

On 13.09.2017 11:10, Cornelia Huck wrote:
> The default cpu model on s390x does not provide zPCI, which is
> not yet wired up on tcg. Moreover, virtio-ccw is the standard
> on s390x.
> 
> Using virtio-scsi will implicitly pick the right device, so just
> switch to that for simplicity.
> 
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>  tests/qemu-iotests/067     | 3 ++-
>  tests/qemu-iotests/067.out | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/qemu-iotests/067 b/tests/qemu-iotests/067
> index 5d4ca4bc61..cbb3da286a 100755
> --- a/tests/qemu-iotests/067
> +++ b/tests/qemu-iotests/067
> @@ -141,7 +141,7 @@ echo
>  echo === Empty drive with -device and device_del ===
>  echo
>  
> -run_qemu -device virtio-scsi-pci -device scsi-cd,id=cd0 <<EOF
> +run_qemu -device virtio-scsi -device scsi-cd,id=cd0 <<EOF
>  { "execute": "qmp_capabilities" }
>  { "execute": "query-block" }
>  { "execute": "device_del", "arguments": { "id": "cd0" } }
> @@ -150,6 +150,7 @@ run_qemu -device virtio-scsi-pci -device scsi-cd,id=cd0 <<EOF
>  { "execute": "quit" }
>  EOF
>  
> +
>  # success, all done
>  echo "*** done"
>  rm -f $seq.full
> diff --git a/tests/qemu-iotests/067.out b/tests/qemu-iotests/067.out
> index bd70557ddc..58e83c4505 100644
> --- a/tests/qemu-iotests/067.out
> +++ b/tests/qemu-iotests/067.out
> @@ -419,7 +419,7 @@ Testing:
>  
>  === Empty drive with -device and device_del ===
>  
> -Testing: -device virtio-scsi-pci -device scsi-cd,id=cd0
> +Testing: -device virtio-scsi -device scsi-cd,id=cd0
>  {
>      QMP_VERSION
>  }
> 

Certainly not wrong to use the old alias in some tests, as long as we
test both variants.

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 

Thanks,

David

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2 0/3] iotests: cure s390x failures by switching to ccw/aliases
  2017-09-13  9:10 [Qemu-devel] [PATCH v2 0/3] iotests: cure s390x failures by switching to ccw/aliases Cornelia Huck
                   ` (2 preceding siblings ...)
  2017-09-13  9:10 ` [Qemu-devel] [PATCH v2 3/3] iotests: use virtio aliases for 067 Cornelia Huck
@ 2017-09-15  7:04 ` QingFeng Hao
  2017-09-15 12:11 ` Kevin Wolf
  4 siblings, 0 replies; 11+ messages in thread
From: QingFeng Hao @ 2017-09-15  7:04 UTC (permalink / raw)
  To: Cornelia Huck, kwolf, mreitz
  Cc: qemu-block, qemu-devel, borntraeger, agraf, thuth, david

Reviewed-by: QingFeng Hao <haoqf@linux.vnet.ibm.com>

for the series of patches.

Thanks


在 2017/9/13 17:10, Cornelia Huck 写道:
> Recent changes in s390x made pci support dependant on the zpci cpu
> feature, which is not provided on all models (and not on by default).
> This means we cannot instatiate pci devices on a standard qemu
> invocation for s390x. Moreover, the zpci instructions are not even
> wired up for tcg yet, so actually doing anything with those pci devices
> is bound to fail on tcg.
>
> For 040, 051, 139, and 182, this can be fixed by switching to virtio-ccw
> from virtio-pci on s390x. 051 also needs a bit of post-processing on
> the output.
>
> For 067, it is easier to switch to virtio aliases, which will pick
> virtio-ccw on s390x and virtio-pci elsewhere. It also exercises the
> aliasing path.
>
> v1->v2:
> - avoid adding new reference output by adding post-processing to 051
>    and switching to aliases for 067
>
> Cornelia Huck (3):
>    iotests: use -ccw on s390x for 040, 139, and 182
>    iotests: use -ccw on s390x for 051
>    iotests: use virtio aliases for 067
>
>   tests/qemu-iotests/040        |  6 +++++-
>   tests/qemu-iotests/051        | 12 +++++++++++-
>   tests/qemu-iotests/051.out    |  2 +-
>   tests/qemu-iotests/051.pc.out |  2 +-
>   tests/qemu-iotests/067        |  3 ++-
>   tests/qemu-iotests/067.out    |  2 +-
>   tests/qemu-iotests/139        | 12 ++++++++++--
>   tests/qemu-iotests/182        | 13 +++++++++++--
>   8 files changed, 42 insertions(+), 10 deletions(-)
>

-- 
Regards
QingFeng Hao

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2 0/3] iotests: cure s390x failures by switching to ccw/aliases
  2017-09-13  9:10 [Qemu-devel] [PATCH v2 0/3] iotests: cure s390x failures by switching to ccw/aliases Cornelia Huck
                   ` (3 preceding siblings ...)
  2017-09-15  7:04 ` [Qemu-devel] [PATCH v2 0/3] iotests: cure s390x failures by switching to ccw/aliases QingFeng Hao
@ 2017-09-15 12:11 ` Kevin Wolf
  4 siblings, 0 replies; 11+ messages in thread
From: Kevin Wolf @ 2017-09-15 12:11 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: mreitz, qemu-block, qemu-devel, borntraeger, agraf, thuth, david, haoqf

Am 13.09.2017 um 11:10 hat Cornelia Huck geschrieben:
> Recent changes in s390x made pci support dependant on the zpci cpu
> feature, which is not provided on all models (and not on by default).
> This means we cannot instatiate pci devices on a standard qemu
> invocation for s390x. Moreover, the zpci instructions are not even
> wired up for tcg yet, so actually doing anything with those pci devices
> is bound to fail on tcg.
> 
> For 040, 051, 139, and 182, this can be fixed by switching to virtio-ccw
> from virtio-pci on s390x. 051 also needs a bit of post-processing on
> the output.
> 
> For 067, it is easier to switch to virtio aliases, which will pick
> virtio-ccw on s390x and virtio-pci elsewhere. It also exercises the
> aliasing path.

Thanks, dropped the whitespace change in patch 3 and applied to the
block branch.

Kevin

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-09-15 12:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-13  9:10 [Qemu-devel] [PATCH v2 0/3] iotests: cure s390x failures by switching to ccw/aliases Cornelia Huck
2017-09-13  9:10 ` [Qemu-devel] [PATCH v2 1/3] iotests: use -ccw on s390x for 040, 139, and 182 Cornelia Huck
2017-09-13 11:59   ` David Hildenbrand
2017-09-13  9:10 ` [Qemu-devel] [PATCH v2 2/3] iotests: use -ccw on s390x for 051 Cornelia Huck
2017-09-13  9:18   ` Thomas Huth
2017-09-13 11:57   ` David Hildenbrand
2017-09-13  9:10 ` [Qemu-devel] [PATCH v2 3/3] iotests: use virtio aliases for 067 Cornelia Huck
2017-09-13  9:17   ` Thomas Huth
2017-09-13 12:02   ` David Hildenbrand
2017-09-15  7:04 ` [Qemu-devel] [PATCH v2 0/3] iotests: cure s390x failures by switching to ccw/aliases QingFeng Hao
2017-09-15 12:11 ` Kevin Wolf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.