All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] iotests: cure s390x failures by switching to ccw
@ 2017-09-05 15:16 Cornelia Huck
  2017-09-05 15:16 ` [Qemu-devel] [PATCH 1/3] iotests: use -ccw on s390x for 040, 139, and 182 Cornelia Huck
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Cornelia Huck @ 2017-09-05 15:16 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.

Let's follow the existing example in 068 and switch to the (default)
virtio-ccw transport on s390x. The changes for 051 and 067 are split
out as they require adding an output file for s390x (the actual command
lines are part of the output).

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

 tests/qemu-iotests/040                     |   6 +-
 tests/qemu-iotests/051                     |   9 +-
 tests/qemu-iotests/051.s390-ccw-virtio.out | 434 +++++++++++++++++++++++++++
 tests/qemu-iotests/067                     |  11 +-
 tests/qemu-iotests/067.s390-ccw-virtio.out | 458 +++++++++++++++++++++++++++++
 tests/qemu-iotests/139                     |  12 +-
 tests/qemu-iotests/182                     |  13 +-
 7 files changed, 936 insertions(+), 7 deletions(-)
 create mode 100644 tests/qemu-iotests/051.s390-ccw-virtio.out
 create mode 100644 tests/qemu-iotests/067.s390-ccw-virtio.out

-- 
2.13.5

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

* [Qemu-devel] [PATCH 1/3] iotests: use -ccw on s390x for 040, 139, and 182
  2017-09-05 15:16 [Qemu-devel] [PATCH 0/3] iotests: cure s390x failures by switching to ccw Cornelia Huck
@ 2017-09-05 15:16 ` Cornelia Huck
  2017-09-08 11:07   ` Kevin Wolf
  2017-09-05 15:16 ` [Qemu-devel] [PATCH 2/3] iotests: use -ccw on s390x for 051 Cornelia Huck
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 20+ messages in thread
From: Cornelia Huck @ 2017-09-05 15:16 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/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] 20+ messages in thread

* [Qemu-devel] [PATCH 2/3] iotests: use -ccw on s390x for 051
  2017-09-05 15:16 [Qemu-devel] [PATCH 0/3] iotests: cure s390x failures by switching to ccw Cornelia Huck
  2017-09-05 15:16 ` [Qemu-devel] [PATCH 1/3] iotests: use -ccw on s390x for 040, 139, and 182 Cornelia Huck
@ 2017-09-05 15:16 ` Cornelia Huck
  2017-09-06  7:19   ` QingFeng Hao
  2017-09-08 11:04   ` Kevin Wolf
  2017-09-05 15:16 ` [Qemu-devel] [PATCH 3/3] iotests: use -ccw on s390x for 067 Cornelia Huck
  2017-09-06  6:57 ` [Qemu-devel] [PATCH 0/3] iotests: cure s390x failures by switching to ccw QingFeng Hao
  3 siblings, 2 replies; 20+ messages in thread
From: Cornelia Huck @ 2017-09-05 15:16 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.

Provide an output file for s390x.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 tests/qemu-iotests/051                     |   9 +-
 tests/qemu-iotests/051.s390-ccw-virtio.out | 434 +++++++++++++++++++++++++++++
 2 files changed, 442 insertions(+), 1 deletion(-)
 create mode 100644 tests/qemu-iotests/051.s390-ccw-virtio.out

diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index c8cfc764bc..f6ad0f4f0b 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -103,7 +103,14 @@ echo
 echo === Device without drive ===
 echo
 
-run_qemu -device virtio-scsi-pci -device scsi-hd
+case "$QEMU_DEFAULT_MACHINE" in
+  s390-ccw-virtio)
+      run_qemu -device virtio-scsi-ccw -device scsi-hd
+      ;;
+  *)
+      run_qemu -device virtio-scsi-pci -device scsi-hd
+      ;;
+esac
 
 echo
 echo === Overriding backing file ===
diff --git a/tests/qemu-iotests/051.s390-ccw-virtio.out b/tests/qemu-iotests/051.s390-ccw-virtio.out
new file mode 100644
index 0000000000..7555f0b73e
--- /dev/null
+++ b/tests/qemu-iotests/051.s390-ccw-virtio.out
@@ -0,0 +1,434 @@
+QA output created by 051
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+
+=== Unknown option ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=,if=none,id=drive0
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=,if=none,id=drive0: Block format 'qcow2' does not support the option 'unknown_opt'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on,if=none,id=drive0
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on,if=none,id=drive0: Block format 'qcow2' does not support the option 'unknown_opt'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234,if=none,id=drive0
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234,if=none,id=drive0: Block format 'qcow2' does not support the option 'unknown_opt'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo,if=none,id=drive0
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo,if=none,id=drive0: Block format 'qcow2' does not support the option 'unknown_opt'
+
+
+=== Unknown protocol option ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=: Block protocol 'file' doesn't support the option 'unknown_opt'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=on
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=on: Block protocol 'file' doesn't support the option 'unknown_opt'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=1234
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=1234: Block protocol 'file' doesn't support the option 'unknown_opt'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=foo
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=foo: Block protocol 'file' doesn't support the option 'unknown_opt'
+
+
+=== Invalid format ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=foo
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=foo: Unknown driver 'foo'
+
+Testing: -drive file=TEST_DIR/t.qcow2,driver=foo
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=foo: Unknown driver 'foo'
+
+Testing: -drive file=TEST_DIR/t.qcow2,driver=raw,format=qcow2
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=raw,format=qcow2: Cannot specify both 'driver' and 'format'
+
+Testing: -drive file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2: Cannot specify both 'driver' and 'format'
+
+
+=== Device without drive ===
+
+Testing: -device virtio-scsi-ccw -device scsi-hd
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device scsi-hd: drive property not set
+
+
+=== Overriding backing file ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,driver=qcow2,backing.file.filename=TEST_DIR/t.qcow2.orig,if=none,id=drive0 -nodefaults
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) info block
+drive0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
+    Removable device: not locked, tray closed
+    Cache mode:       writeback
+    Backing file:     TEST_DIR/t.qcow2.orig (chain depth: 1)
+(qemu) quit
+
+Testing: -drive file=TEST_DIR/t.qcow2,driver=raw,backing.file.filename=TEST_DIR/t.qcow2.orig
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=raw,backing.file.filename=TEST_DIR/t.qcow2.orig: Driver doesn't support backing files
+
+Testing: -drive file=TEST_DIR/t.qcow2,file.backing.driver=file,file.backing.filename=TEST_DIR/t.qcow2.orig
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,file.backing.driver=file,file.backing.filename=TEST_DIR/t.qcow2.orig: Driver doesn't support backing files
+
+Testing: -drive file=TEST_DIR/t.qcow2,file.backing.driver=qcow2,file.backing.file.filename=TEST_DIR/t.qcow2.orig
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,file.backing.driver=qcow2,file.backing.file.filename=TEST_DIR/t.qcow2.orig: Driver doesn't support backing files
+
+
+=== Enable and disable lazy refcounting on the command line, plus some invalid values ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) quit
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=off
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) quit
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=: Parameter 'lazy-refcounts' expects 'on' or 'off'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=42
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=42: Parameter 'lazy-refcounts' expects 'on' or 'off'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=foo
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=foo: Parameter 'lazy-refcounts' expects 'on' or 'off'
+
+
+=== With version 2 images enabling lazy refcounts must fail ===
+
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on: Lazy refcounts require a qcow2 image with at least qemu 1.1 compatibility level
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=off
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) quit
+
+
+=== No medium ===
+
+Testing: -drive if=virtio
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -drive if=virtio: Device needs media, but drive is empty
+
+
+=== Read-only ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=virtio,readonly=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) quit
+
+
+=== Cache modes ===
+
+Testing: -drive driver=null-co,cache=none
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) quit
+
+Testing: -drive driver=null-co,cache=directsync
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) quit
+
+Testing: -drive driver=null-co,cache=writeback
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) quit
+
+Testing: -drive driver=null-co,cache=writethrough
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) quit
+
+Testing: -drive driver=null-co,cache=unsafe
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) quit
+
+Testing: -drive driver=null-co,cache=invalid_value
+QEMU_PROG: -drive driver=null-co,cache=invalid_value: invalid cache option
+
+Testing: -drive file=TEST_DIR/t.qcow2,cache=writeback,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0 -nodefaults
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) info block
+drive0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
+    Removable device: not locked, tray closed
+    Cache mode:       writeback
+    Backing file:     TEST_DIR/t.qcow2.base (chain depth: 1)
+(qemu) info block file
+
+file: TEST_DIR/t.qcow2 (file)
+    Cache mode:       writeback
+(qemu) info block backing
+backing: TEST_DIR/t.qcow2.base (qcow2, read-only)
+    Cache mode:       writeback, ignore flushes
+(qemu) info block backing-file
+
+backing-file: TEST_DIR/t.qcow2.base (file, read-only)
+    Cache mode:       writeback, ignore flushes
+(qemu) quit
+
+Testing: -drive file=TEST_DIR/t.qcow2,cache=writethrough,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0 -nodefaults
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) info block
+drive0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
+    Removable device: not locked, tray closed
+    Cache mode:       writethrough
+    Backing file:     TEST_DIR/t.qcow2.base (chain depth: 1)
+(qemu) info block file
+
+file: TEST_DIR/t.qcow2 (file)
+    Cache mode:       writeback
+(qemu) info block backing
+backing: TEST_DIR/t.qcow2.base (qcow2, read-only)
+    Cache mode:       writeback, ignore flushes
+(qemu) info block backing-file
+
+backing-file: TEST_DIR/t.qcow2.base (file, read-only)
+    Cache mode:       writeback, ignore flushes
+(qemu) quit
+
+Testing: -drive file=TEST_DIR/t.qcow2,cache=unsafe,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0 -nodefaults
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) info block
+drive0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
+    Removable device: not locked, tray closed
+    Cache mode:       writeback, ignore flushes
+    Backing file:     TEST_DIR/t.qcow2.base (chain depth: 1)
+(qemu) info block file
+
+file: TEST_DIR/t.qcow2 (file)
+    Cache mode:       writeback, ignore flushes
+(qemu) info block backing
+backing: TEST_DIR/t.qcow2.base (qcow2, read-only)
+    Cache mode:       writeback, ignore flushes
+(qemu) info block backing-file
+
+backing-file: TEST_DIR/t.qcow2.base (file, read-only)
+    Cache mode:       writeback, ignore flushes
+(qemu) quit
+
+Testing: -drive file=TEST_DIR/t.qcow2,cache=invalid_value,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0 -nodefaults
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,cache=invalid_value,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0: invalid cache option
+
+
+=== Specifying the protocol layer ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,file.driver=file
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) quit
+
+
+=== Leaving out required options ===
+
+Testing: -drive driver=file
+QEMU_PROG: -drive driver=file: The 'file' block driver requires a file name
+
+Testing: -drive driver=file,filename=
+QEMU_PROG: -drive driver=file,filename=: The 'file' block driver requires a file name
+
+Testing: -drive driver=nbd
+QEMU_PROG: -drive driver=nbd: NBD server address missing
+
+Testing: -drive driver=raw
+QEMU_PROG: -drive driver=raw: A block device must be specified for "file"
+
+Testing: -drive file.driver=file
+QEMU_PROG: -drive file.driver=file: The 'file' block driver requires a file name
+
+Testing: -drive file.driver=nbd
+QEMU_PROG: -drive file.driver=nbd: NBD server address missing
+
+Testing: -drive file.driver=raw
+QEMU_PROG: -drive file.driver=raw: A block device must be specified for "file"
+
+Testing: -drive foo=bar
+QEMU_PROG: -drive foo=bar: Must specify either driver or file
+
+
+=== Specifying both an option and its legacy alias ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,iops=1234,throttling.iops-total=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops=1234,throttling.iops-total=5678: 'throttling.iops-total' and its alias 'iops' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,iops_rd=1234,throttling.iops-read=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops_rd=1234,throttling.iops-read=5678: 'throttling.iops-read' and its alias 'iops_rd' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,iops_wr=1234,throttling.iops-write=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops_wr=1234,throttling.iops-write=5678: 'throttling.iops-write' and its alias 'iops_wr' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps=1234,throttling.bps-total=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps=1234,throttling.bps-total=5678: 'throttling.bps-total' and its alias 'bps' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps_rd=1234,throttling.bps-read=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_rd=1234,throttling.bps-read=5678: 'throttling.bps-read' and its alias 'bps_rd' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps_wr=1234,throttling.bps-write=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_wr=1234,throttling.bps-write=5678: 'throttling.bps-write' and its alias 'bps_wr' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,iops_max=1234,throttling.iops-total-max=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops_max=1234,throttling.iops-total-max=5678: 'throttling.iops-total-max' and its alias 'iops_max' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,iops_rd_max=1234,throttling.iops-read-max=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops_rd_max=1234,throttling.iops-read-max=5678: 'throttling.iops-read-max' and its alias 'iops_rd_max' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,iops_wr_max=1234,throttling.iops-write-max=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops_wr_max=1234,throttling.iops-write-max=5678: 'throttling.iops-write-max' and its alias 'iops_wr_max' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps_max=1234,throttling.bps-total-max=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_max=1234,throttling.bps-total-max=5678: 'throttling.bps-total-max' and its alias 'bps_max' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps_rd_max=1234,throttling.bps-read-max=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_rd_max=1234,throttling.bps-read-max=5678: 'throttling.bps-read-max' and its alias 'bps_rd_max' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps_wr_max=1234,throttling.bps-write-max=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_wr_max=1234,throttling.bps-write-max=5678: 'throttling.bps-write-max' and its alias 'bps_wr_max' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,iops_size=1234,throttling.iops-size=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops_size=1234,throttling.iops-size=5678: 'throttling.iops-size' and its alias 'iops_size' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,readonly=on,read-only=off
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,readonly=on,read-only=off: 'read-only' and its alias 'readonly' can't be used at the same time
+
+
+=== Catching negative/large throttling values ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,iops=-1
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops=-1: bps/iops/max values must be within [0, 1000000000000000]
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps=-2
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps=-2: bps/iops/max values must be within [0, 1000000000000000]
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps_rd=-3
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_rd=-3: bps/iops/max values must be within [0, 1000000000000000]
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps_rd_max=-3
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_rd_max=-3: bps/iops/max values must be within [0, 1000000000000000]
+
+Testing: -drive file=TEST_DIR/t.qcow2,throttling.iops-total=-4
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,throttling.iops-total=-4: bps/iops/max values must be within [0, 1000000000000000]
+
+Testing: -drive file=TEST_DIR/t.qcow2,throttling.bps-total=-5
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,throttling.bps-total=-5: bps/iops/max values must be within [0, 1000000000000000]
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps=0
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) quit
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps=1
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) quit
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps=1000000000000000
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) quit
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps=1000000000000001
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps=1000000000000001: bps/iops/max values must be within [0, 1000000000000000]
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps=9999999999999999
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps=9999999999999999: bps/iops/max values must be within [0, 1000000000000000]
+
+
+=== Parsing protocol from file name ===
+
+Testing: -hda foo:bar
+QEMU_PROG: -hda foo:bar: Unknown protocol 'foo'
+
+Testing: -drive file=foo:bar
+QEMU_PROG: -drive file=foo:bar: Unknown protocol 'foo'
+
+Testing: -drive file.filename=foo:bar
+QEMU_PROG: -drive file.filename=foo:bar: Could not open 'foo:bar': No such file or directory
+
+Testing: -hda file:TEST_DIR/t.qcow2
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) quit
+
+Testing: -drive file=file:TEST_DIR/t.qcow2
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) quit
+
+Testing: -drive file.filename=file:TEST_DIR/t.qcow2
+QEMU_PROG: -drive file.filename=file:TEST_DIR/t.qcow2: Could not open 'file:TEST_DIR/t.qcow2': No such file or directory
+
+
+=== Snapshot mode ===
+
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=drive0 -snapshot
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qemu-io drive0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) quit
+
+Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on,if=none,id=drive0
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qemu-io drive0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) quit
+
+Testing: -drive file.filename=TEST_DIR/t.qcow2,driver=qcow2,snapshot=on,if=none,id=drive0
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qemu-io drive0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) quit
+
+Testing: -drive file.filename=TEST_DIR/t.qcow2,driver=qcow2,if=none,id=drive0 -snapshot
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qemu-io drive0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) quit
+
+Testing: -drive file=file:TEST_DIR/t.qcow2,if=none,id=drive0 -snapshot
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qemu-io drive0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) quit
+
+Testing: -drive file=file:TEST_DIR/t.qcow2,snapshot=on,if=none,id=drive0
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qemu-io drive0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) quit
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=drive0 -snapshot
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qemu-io drive0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) quit
+
+Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on,if=none,id=drive0
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qemu-io drive0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) quit
+
+read 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Testing: -drive file=TEST_DIR/t.qcow2,snapshot=off,if=none,id=drive0
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qemu-io drive0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) quit
+
+read 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on,if=none,id=drive0
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qemu-io drive0 "write -P 0x33 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) commit drive0
+(qemu) quit
+
+read 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+*** done
-- 
2.13.5

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

* [Qemu-devel] [PATCH 3/3] iotests: use -ccw on s390x for 067
  2017-09-05 15:16 [Qemu-devel] [PATCH 0/3] iotests: cure s390x failures by switching to ccw Cornelia Huck
  2017-09-05 15:16 ` [Qemu-devel] [PATCH 1/3] iotests: use -ccw on s390x for 040, 139, and 182 Cornelia Huck
  2017-09-05 15:16 ` [Qemu-devel] [PATCH 2/3] iotests: use -ccw on s390x for 051 Cornelia Huck
@ 2017-09-05 15:16 ` Cornelia Huck
  2017-09-08 11:06   ` Kevin Wolf
  2017-09-06  6:57 ` [Qemu-devel] [PATCH 0/3] iotests: cure s390x failures by switching to ccw QingFeng Hao
  3 siblings, 1 reply; 20+ messages in thread
From: Cornelia Huck @ 2017-09-05 15:16 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.

Provide an output file for s390x.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 tests/qemu-iotests/067                     |  11 +-
 tests/qemu-iotests/067.s390-ccw-virtio.out | 458 +++++++++++++++++++++++++++++
 2 files changed, 468 insertions(+), 1 deletion(-)
 create mode 100644 tests/qemu-iotests/067.s390-ccw-virtio.out

diff --git a/tests/qemu-iotests/067 b/tests/qemu-iotests/067
index 5d4ca4bc61..c5db04fb50 100755
--- a/tests/qemu-iotests/067
+++ b/tests/qemu-iotests/067
@@ -37,6 +37,15 @@ _supported_os Linux
 # Because anything other than 16 would change the output of query-block
 _unsupported_imgopts 'refcount_bits=\([^1]\|.\([^6]\|$\)\)'
 
+case "$QEMU_DEFAULT_MACHINE" in
+  s390-ccw-virtio)
+      hba=virtio-scsi-ccw
+      ;;
+  *)
+      hba=virtio-scsi-pci
+      ;;
+esac
+
 function do_run_qemu()
 {
     echo Testing: "$@"
@@ -141,7 +150,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 $hba -device scsi-cd,id=cd0 <<EOF
 { "execute": "qmp_capabilities" }
 { "execute": "query-block" }
 { "execute": "device_del", "arguments": { "id": "cd0" } }
diff --git a/tests/qemu-iotests/067.s390-ccw-virtio.out b/tests/qemu-iotests/067.s390-ccw-virtio.out
new file mode 100644
index 0000000000..55315c6efd
--- /dev/null
+++ b/tests/qemu-iotests/067.s390-ccw-virtio.out
@@ -0,0 +1,458 @@
+QA output created by 067
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
+
+=== -drive/-device and device_del ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,if=none,id=disk -device virtio-blk,drive=disk,id=virtio0
+{
+    QMP_VERSION
+}
+{
+    "return": {
+    }
+}
+{
+    "return": [
+        {
+            "io-status": "ok",
+            "device": "disk",
+            "locked": false,
+            "removable": false,
+            "inserted": {
+                "iops_rd": 0,
+                "detect_zeroes": "off",
+                "image": {
+                    "virtual-size": 134217728,
+                    "filename": "TEST_DIR/t.qcow2",
+                    "cluster-size": 65536,
+                    "format": "qcow2",
+                    "actual-size": SIZE,
+                    "format-specific": {
+                        "type": "qcow2",
+                        "data": {
+                            "compat": "1.1",
+                            "lazy-refcounts": false,
+                            "refcount-bits": 16,
+                            "corrupt": false
+                        }
+                    },
+                    "dirty-flag": false
+                },
+                "iops_wr": 0,
+                "ro": false,
+                "node-name": "NODE_NAME",
+                "backing_file_depth": 0,
+                "drv": "qcow2",
+                "iops": 0,
+                "bps_wr": 0,
+                "write_threshold": 0,
+                "encrypted": false,
+                "bps": 0,
+                "bps_rd": 0,
+                "cache": {
+                    "no-flush": false,
+                    "direct": false,
+                    "writeback": true
+                },
+                "file": "TEST_DIR/t.qcow2",
+                "encryption_key_missing": false
+            },
+            "qdev": "/machine/peripheral/virtio0/virtio-backend",
+            "type": "unknown"
+        }
+    ]
+}
+{
+    "return": {
+    }
+}
+{
+    "return": {
+    }
+}
+{
+    "return": [
+    ]
+}
+{
+    "return": {
+    }
+}
+
+=== -drive/device_add and device_del ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,if=none,id=disk
+{
+    QMP_VERSION
+}
+{
+    "return": {
+    }
+}
+{
+    "return": [
+        {
+            "device": "disk",
+            "locked": false,
+            "removable": true,
+            "inserted": {
+                "iops_rd": 0,
+                "detect_zeroes": "off",
+                "image": {
+                    "virtual-size": 134217728,
+                    "filename": "TEST_DIR/t.qcow2",
+                    "cluster-size": 65536,
+                    "format": "qcow2",
+                    "actual-size": SIZE,
+                    "format-specific": {
+                        "type": "qcow2",
+                        "data": {
+                            "compat": "1.1",
+                            "lazy-refcounts": false,
+                            "refcount-bits": 16,
+                            "corrupt": false
+                        }
+                    },
+                    "dirty-flag": false
+                },
+                "iops_wr": 0,
+                "ro": false,
+                "node-name": "NODE_NAME",
+                "backing_file_depth": 0,
+                "drv": "qcow2",
+                "iops": 0,
+                "bps_wr": 0,
+                "write_threshold": 0,
+                "encrypted": false,
+                "bps": 0,
+                "bps_rd": 0,
+                "cache": {
+                    "no-flush": false,
+                    "direct": false,
+                    "writeback": true
+                },
+                "file": "TEST_DIR/t.qcow2",
+                "encryption_key_missing": false
+            },
+            "type": "unknown"
+        }
+    ]
+}
+{
+    "return": {
+    }
+}
+{
+    "return": {
+    }
+}
+{
+    "return": {
+    }
+}
+{
+    "return": [
+    ]
+}
+{
+    "return": {
+    }
+}
+
+=== drive_add/device_add and device_del ===
+
+Testing:
+{
+    QMP_VERSION
+}
+{
+    "return": {
+    }
+}
+{
+    "return": "OK\r\n"
+}
+{
+    "return": [
+        {
+            "device": "disk",
+            "locked": false,
+            "removable": true,
+            "inserted": {
+                "iops_rd": 0,
+                "detect_zeroes": "off",
+                "image": {
+                    "virtual-size": 134217728,
+                    "filename": "TEST_DIR/t.qcow2",
+                    "cluster-size": 65536,
+                    "format": "qcow2",
+                    "actual-size": SIZE,
+                    "format-specific": {
+                        "type": "qcow2",
+                        "data": {
+                            "compat": "1.1",
+                            "lazy-refcounts": false,
+                            "refcount-bits": 16,
+                            "corrupt": false
+                        }
+                    },
+                    "dirty-flag": false
+                },
+                "iops_wr": 0,
+                "ro": false,
+                "node-name": "NODE_NAME",
+                "backing_file_depth": 0,
+                "drv": "qcow2",
+                "iops": 0,
+                "bps_wr": 0,
+                "write_threshold": 0,
+                "encrypted": false,
+                "bps": 0,
+                "bps_rd": 0,
+                "cache": {
+                    "no-flush": false,
+                    "direct": false,
+                    "writeback": true
+                },
+                "file": "TEST_DIR/t.qcow2",
+                "encryption_key_missing": false
+            },
+            "type": "unknown"
+        }
+    ]
+}
+{
+    "return": {
+    }
+}
+{
+    "return": {
+    }
+}
+{
+    "return": {
+    }
+}
+{
+    "return": [
+    ]
+}
+{
+    "return": {
+    }
+}
+
+=== blockdev_add/device_add and device_del ===
+
+Testing:
+{
+    QMP_VERSION
+}
+{
+    "return": {
+    }
+}
+{
+    "return": {
+    }
+}
+{
+    "return": [
+        {
+            "iops_rd": 0,
+            "detect_zeroes": "off",
+            "image": {
+                "virtual-size": 134217728,
+                "filename": "TEST_DIR/t.qcow2",
+                "cluster-size": 65536,
+                "format": "qcow2",
+                "actual-size": SIZE,
+                "format-specific": {
+                    "type": "qcow2",
+                    "data": {
+                        "compat": "1.1",
+                        "lazy-refcounts": false,
+                        "refcount-bits": 16,
+                        "corrupt": false
+                    }
+                },
+                "dirty-flag": false
+            },
+            "iops_wr": 0,
+            "ro": false,
+            "node-name": "disk",
+            "backing_file_depth": 0,
+            "drv": "qcow2",
+            "iops": 0,
+            "bps_wr": 0,
+            "write_threshold": 0,
+            "encrypted": false,
+            "bps": 0,
+            "bps_rd": 0,
+            "cache": {
+                "no-flush": false,
+                "direct": false,
+                "writeback": true
+            },
+            "file": "TEST_DIR/t.qcow2",
+            "encryption_key_missing": false
+        },
+        {
+            "iops_rd": 0,
+            "detect_zeroes": "off",
+            "image": {
+                "virtual-size": 197120,
+                "filename": "TEST_DIR/t.qcow2",
+                "format": "file",
+                "actual-size": SIZE,
+                "dirty-flag": false
+            },
+            "iops_wr": 0,
+            "ro": false,
+            "node-name": "NODE_NAME",
+            "backing_file_depth": 0,
+            "drv": "file",
+            "iops": 0,
+            "bps_wr": 0,
+            "write_threshold": 0,
+            "encrypted": false,
+            "bps": 0,
+            "bps_rd": 0,
+            "cache": {
+                "no-flush": false,
+                "direct": false,
+                "writeback": true
+            },
+            "file": "TEST_DIR/t.qcow2",
+            "encryption_key_missing": false
+        }
+    ]
+}
+{
+    "return": {
+    }
+}
+{
+    "return": {
+    }
+}
+{
+    "return": {
+    }
+}
+{
+    "return": [
+        {
+            "iops_rd": 0,
+            "detect_zeroes": "off",
+            "image": {
+                "virtual-size": 134217728,
+                "filename": "TEST_DIR/t.qcow2",
+                "cluster-size": 65536,
+                "format": "qcow2",
+                "actual-size": SIZE,
+                "format-specific": {
+                    "type": "qcow2",
+                    "data": {
+                        "compat": "1.1",
+                        "lazy-refcounts": false,
+                        "refcount-bits": 16,
+                        "corrupt": false
+                    }
+                },
+                "dirty-flag": false
+            },
+            "iops_wr": 0,
+            "ro": false,
+            "node-name": "disk",
+            "backing_file_depth": 0,
+            "drv": "qcow2",
+            "iops": 0,
+            "bps_wr": 0,
+            "write_threshold": 0,
+            "encrypted": false,
+            "bps": 0,
+            "bps_rd": 0,
+            "cache": {
+                "no-flush": false,
+                "direct": false,
+                "writeback": true
+            },
+            "file": "TEST_DIR/t.qcow2",
+            "encryption_key_missing": false
+        },
+        {
+            "iops_rd": 0,
+            "detect_zeroes": "off",
+            "image": {
+                "virtual-size": 197120,
+                "filename": "TEST_DIR/t.qcow2",
+                "format": "file",
+                "actual-size": SIZE,
+                "dirty-flag": false
+            },
+            "iops_wr": 0,
+            "ro": false,
+            "node-name": "NODE_NAME",
+            "backing_file_depth": 0,
+            "drv": "file",
+            "iops": 0,
+            "bps_wr": 0,
+            "write_threshold": 0,
+            "encrypted": false,
+            "bps": 0,
+            "bps_rd": 0,
+            "cache": {
+                "no-flush": false,
+                "direct": false,
+                "writeback": true
+            },
+            "file": "TEST_DIR/t.qcow2",
+            "encryption_key_missing": false
+        }
+    ]
+}
+{
+    "return": {
+    }
+}
+
+=== Empty drive with -device and device_del ===
+
+Testing: -device virtio-scsi-ccw -device scsi-cd,id=cd0
+{
+    QMP_VERSION
+}
+{
+    "return": {
+    }
+}
+{
+    "return": [
+        {
+            "device": "",
+            "locked": false,
+            "removable": true,
+            "qdev": "cd0",
+            "tray_open": false,
+            "type": "unknown"
+        }
+    ]
+}
+{
+    "return": {
+    }
+}
+{
+    "return": {
+    }
+}
+{
+    "return": [
+    ]
+}
+{
+    "return": {
+    }
+}
+*** done
-- 
2.13.5

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

* Re: [Qemu-devel] [PATCH 0/3] iotests: cure s390x failures by switching to ccw
  2017-09-05 15:16 [Qemu-devel] [PATCH 0/3] iotests: cure s390x failures by switching to ccw Cornelia Huck
                   ` (2 preceding siblings ...)
  2017-09-05 15:16 ` [Qemu-devel] [PATCH 3/3] iotests: use -ccw on s390x for 067 Cornelia Huck
@ 2017-09-06  6:57 ` QingFeng Hao
  2017-09-06  7:17   ` Cornelia Huck
  2017-09-06  7:59   ` Cornelia Huck
  3 siblings, 2 replies; 20+ messages in thread
From: QingFeng Hao @ 2017-09-06  6:57 UTC (permalink / raw)
  To: Cornelia Huck, kwolf, mreitz
  Cc: qemu-block, qemu-devel, borntraeger, agraf, thuth, david, Yi Min Zhao



在 2017/9/5 23:16, 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.
>
> Let's follow the existing example in 068 and switch to the (default)
> virtio-ccw transport on s390x. The changes for 051 and 067 are split
> out as they require adding an output file for s390x (the actual command
> lines are part of the output).
We also found this error and YiMin suggested to change the code in ccw_init
as below:

if (pci_available) {
     DeviceState *dev = qdev_create(NULL, TYPE_S390_PCI_HOST_BRIDGE);
     ...
}
We tested it and it can make the 5 cases passed.
How do you think this? :-)
Thanks!

>
> Cornelia Huck (3):
>    iotests: use -ccw on s390x for 040, 139, and 182
>    iotests: use -ccw on s390x for 051
>    iotests: use -ccw on s390x for 067
>
>   tests/qemu-iotests/040                     |   6 +-
>   tests/qemu-iotests/051                     |   9 +-
>   tests/qemu-iotests/051.s390-ccw-virtio.out | 434 +++++++++++++++++++++++++++
>   tests/qemu-iotests/067                     |  11 +-
>   tests/qemu-iotests/067.s390-ccw-virtio.out | 458 +++++++++++++++++++++++++++++
>   tests/qemu-iotests/139                     |  12 +-
>   tests/qemu-iotests/182                     |  13 +-
>   7 files changed, 936 insertions(+), 7 deletions(-)
>   create mode 100644 tests/qemu-iotests/051.s390-ccw-virtio.out
>   create mode 100644 tests/qemu-iotests/067.s390-ccw-virtio.out
>

-- 
Regards
QingFeng Hao

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

* Re: [Qemu-devel] [PATCH 0/3] iotests: cure s390x failures by switching to ccw
  2017-09-06  6:57 ` [Qemu-devel] [PATCH 0/3] iotests: cure s390x failures by switching to ccw QingFeng Hao
@ 2017-09-06  7:17   ` Cornelia Huck
  2017-09-06  7:59   ` Cornelia Huck
  1 sibling, 0 replies; 20+ messages in thread
From: Cornelia Huck @ 2017-09-06  7:17 UTC (permalink / raw)
  To: QingFeng Hao
  Cc: kwolf, mreitz, qemu-block, qemu-devel, borntraeger, agraf, thuth,
	david, Yi Min Zhao

On Wed, 6 Sep 2017 14:57:48 +0800
QingFeng Hao <haoqf@linux.vnet.ibm.com> wrote:

> 在 2017/9/5 23:16, 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.
> >
> > Let's follow the existing example in 068 and switch to the (default)
> > virtio-ccw transport on s390x. The changes for 051 and 067 are split
> > out as they require adding an output file for s390x (the actual command
> > lines are part of the output).  
> We also found this error and YiMin suggested to change the code in ccw_init
> as below:
> 
> if (pci_available) {
>      DeviceState *dev = qdev_create(NULL, TYPE_S390_PCI_HOST_BRIDGE);
>      ...
> }
> We tested it and it can make the 5 cases passed.
> How do you think this? :-)

I can take a look at this.

But I think we want to prefer ccw for s390x in the tests in any case,
for the reasons stated above.

> Thanks!
> 
> >
> > Cornelia Huck (3):
> >    iotests: use -ccw on s390x for 040, 139, and 182
> >    iotests: use -ccw on s390x for 051
> >    iotests: use -ccw on s390x for 067
> >
> >   tests/qemu-iotests/040                     |   6 +-
> >   tests/qemu-iotests/051                     |   9 +-
> >   tests/qemu-iotests/051.s390-ccw-virtio.out | 434 +++++++++++++++++++++++++++
> >   tests/qemu-iotests/067                     |  11 +-
> >   tests/qemu-iotests/067.s390-ccw-virtio.out | 458 +++++++++++++++++++++++++++++
> >   tests/qemu-iotests/139                     |  12 +-
> >   tests/qemu-iotests/182                     |  13 +-
> >   7 files changed, 936 insertions(+), 7 deletions(-)
> >   create mode 100644 tests/qemu-iotests/051.s390-ccw-virtio.out
> >   create mode 100644 tests/qemu-iotests/067.s390-ccw-virtio.out
> >  
> 

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

* Re: [Qemu-devel] [PATCH 2/3] iotests: use -ccw on s390x for 051
  2017-09-05 15:16 ` [Qemu-devel] [PATCH 2/3] iotests: use -ccw on s390x for 051 Cornelia Huck
@ 2017-09-06  7:19   ` QingFeng Hao
  2017-09-06  7:32     ` Cornelia Huck
  2017-09-08 11:04   ` Kevin Wolf
  1 sibling, 1 reply; 20+ messages in thread
From: QingFeng Hao @ 2017-09-06  7:19 UTC (permalink / raw)
  To: Cornelia Huck, kwolf, mreitz
  Cc: qemu-block, qemu-devel, borntraeger, agraf, thuth, david,
	Yi Min Zhao, bjsdjshi



在 2017/9/5 23:16, 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.
>
> Provide an output file for s390x.
>
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>   tests/qemu-iotests/051                     |   9 +-
>   tests/qemu-iotests/051.s390-ccw-virtio.out | 434 +++++++++++++++++++++++++++++
>   2 files changed, 442 insertions(+), 1 deletion(-)
>   create mode 100644 tests/qemu-iotests/051.s390-ccw-virtio.out
>
> diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
> index c8cfc764bc..f6ad0f4f0b 100755
> --- a/tests/qemu-iotests/051
> +++ b/tests/qemu-iotests/051
> @@ -103,7 +103,14 @@ echo
>   echo === Device without drive ===
>   echo
>
> -run_qemu -device virtio-scsi-pci -device scsi-hd
> +case "$QEMU_DEFAULT_MACHINE" in
> +  s390-ccw-virtio)
> +      run_qemu -device virtio-scsi-ccw -device scsi-hd
> +      ;;
> +  *)
> +      run_qemu -device virtio-scsi-pci -device scsi-hd
> +      ;;
> +esac
>
>   echo
>   echo === Overriding backing file ===
Regarding the new output file, I have a doubt that why there is no 
change on "check"
script where the result check is located:
if diff -w "$reference" $tmp.out >/dev/null 2>&1
Thanks!
> diff --git a/tests/qemu-iotests/051.s390-ccw-virtio.out b/tests/qemu-iotests/051.s390-ccw-virtio.out
> new file mode 100644
> index 0000000000..7555f0b73e
> --- /dev/null
> +++ b/tests/qemu-iotests/051.s390-ccw-virtio.out
[...]

-- 
Regards
QingFeng Hao

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

* Re: [Qemu-devel] [PATCH 2/3] iotests: use -ccw on s390x for 051
  2017-09-06  7:19   ` QingFeng Hao
@ 2017-09-06  7:32     ` Cornelia Huck
  2017-09-06  8:42       ` QingFeng Hao
  0 siblings, 1 reply; 20+ messages in thread
From: Cornelia Huck @ 2017-09-06  7:32 UTC (permalink / raw)
  To: QingFeng Hao
  Cc: kwolf, mreitz, qemu-block, qemu-devel, borntraeger, agraf, thuth,
	david, Yi Min Zhao, bjsdjshi

On Wed, 6 Sep 2017 15:19:01 +0800
QingFeng Hao <haoqf@linux.vnet.ibm.com> wrote:

> 在 2017/9/5 23:16, 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.
> >
> > Provide an output file for s390x.
> >
> > Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> > ---
> >   tests/qemu-iotests/051                     |   9 +-
> >   tests/qemu-iotests/051.s390-ccw-virtio.out | 434 +++++++++++++++++++++++++++++
> >   2 files changed, 442 insertions(+), 1 deletion(-)
> >   create mode 100644 tests/qemu-iotests/051.s390-ccw-virtio.out
> >
> > diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
> > index c8cfc764bc..f6ad0f4f0b 100755
> > --- a/tests/qemu-iotests/051
> > +++ b/tests/qemu-iotests/051
> > @@ -103,7 +103,14 @@ echo
> >   echo === Device without drive ===
> >   echo
> >
> > -run_qemu -device virtio-scsi-pci -device scsi-hd
> > +case "$QEMU_DEFAULT_MACHINE" in
> > +  s390-ccw-virtio)
> > +      run_qemu -device virtio-scsi-ccw -device scsi-hd
> > +      ;;
> > +  *)
> > +      run_qemu -device virtio-scsi-pci -device scsi-hd
> > +      ;;
> > +esac
> >
> >   echo
> >   echo === Overriding backing file ===  
> Regarding the new output file, I have a doubt that why there is no 
> change on "check"
> script where the result check is located:
> if diff -w "$reference" $tmp.out >/dev/null 2>&1

The right output reference should be picked as of

commit e166b4148208656635ea2fe39df8b1e875a34fb8
Author: Bo Tu <tubo@linux.vnet.ibm.com>
Date:   Fri Jul 3 15:28:46 2015 +0800

    qemu-iotests: qemu machine type support
    
    This patch adds qemu machine type support to the io test suite.
    Based on the qemu default machine type and alias of the default machine
    type the reference output file can now vary from the default to a
    machine specific output file if necessary. When using a machine specific
    reference file if the default machine has an alias then use the alias as the output
    file name otherwise use the default machine name as the output file name.
    
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Reviewed-by: Michael Mueller <mimu@linux.vnet.ibm.com>
    Reviewed-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
    Signed-off-by: Xiao Guang Chen <chenxg@linux.vnet.ibm.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>

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

* Re: [Qemu-devel] [PATCH 0/3] iotests: cure s390x failures by switching to ccw
  2017-09-06  6:57 ` [Qemu-devel] [PATCH 0/3] iotests: cure s390x failures by switching to ccw QingFeng Hao
  2017-09-06  7:17   ` Cornelia Huck
@ 2017-09-06  7:59   ` Cornelia Huck
  2017-09-06  8:09     ` Yi Min Zhao
  1 sibling, 1 reply; 20+ messages in thread
From: Cornelia Huck @ 2017-09-06  7:59 UTC (permalink / raw)
  To: QingFeng Hao
  Cc: kwolf, mreitz, qemu-block, qemu-devel, borntraeger, agraf, thuth,
	david, Yi Min Zhao

On Wed, 6 Sep 2017 14:57:48 +0800
QingFeng Hao <haoqf@linux.vnet.ibm.com> wrote:

> 在 2017/9/5 23:16, 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.
> >
> > Let's follow the existing example in 068 and switch to the (default)
> > virtio-ccw transport on s390x. The changes for 051 and 067 are split
> > out as they require adding an output file for s390x (the actual command
> > lines are part of the output).  
> We also found this error and YiMin suggested to change the code in ccw_init
> as below:
> 
> if (pci_available) {
>      DeviceState *dev = qdev_create(NULL, TYPE_S390_PCI_HOST_BRIDGE);
>      ...
> }
> We tested it and it can make the 5 cases passed.

OK, looked at this. This won't work: pci_available means "this qemu has
pci support built in". _Working_ zpci, however, depends on the presence
of the zpci feature bit: You'll have a host bridge and can define
devices that have absolutely no chance of working, since all pci
instruction will return errors. You will be in a similar situation
under kvm as under tcg: you can specify virtio-pci devices on the
command line, but they can't work.

This probably makes the 5 cases pass as they only rely on the ability
to create the device, not to do anything with them.

So, I still think the right thing to do is to switch to ccw in the
tests (and to wire up pci in tcg, but that's an orthogonal issue).

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

* Re: [Qemu-devel] [PATCH 0/3] iotests: cure s390x failures by switching to ccw
  2017-09-06  7:59   ` Cornelia Huck
@ 2017-09-06  8:09     ` Yi Min Zhao
  0 siblings, 0 replies; 20+ messages in thread
From: Yi Min Zhao @ 2017-09-06  8:09 UTC (permalink / raw)
  To: Cornelia Huck, QingFeng Hao
  Cc: kwolf, mreitz, qemu-block, qemu-devel, borntraeger, agraf, thuth, david



在 2017/9/6 下午3:59, Cornelia Huck 写道:
> On Wed, 6 Sep 2017 14:57:48 +0800
> QingFeng Hao <haoqf@linux.vnet.ibm.com> wrote:
>
>> 在 2017/9/5 23:16, 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.
>>>
>>> Let's follow the existing example in 068 and switch to the (default)
>>> virtio-ccw transport on s390x. The changes for 051 and 067 are split
>>> out as they require adding an output file for s390x (the actual command
>>> lines are part of the output).
>> We also found this error and YiMin suggested to change the code in ccw_init
>> as below:
>>
>> if (pci_available) {
>>       DeviceState *dev = qdev_create(NULL, TYPE_S390_PCI_HOST_BRIDGE);
>>       ...
>> }
>> We tested it and it can make the 5 cases passed.
> OK, looked at this. This won't work: pci_available means "this qemu has
> pci support built in". _Working_ zpci, however, depends on the presence
> of the zpci feature bit: You'll have a host bridge and can define
> devices that have absolutely no chance of working, since all pci
> instruction will return errors. You will be in a similar situation
> under kvm as under tcg: you can specify virtio-pci devices on the
> command line, but they can't work.
Oh. Yes, that makes sense. Actually the first way we thought about was 
change the code
not change the testcases. Thanks for your work.
>
> This probably makes the 5 cases pass as they only rely on the ability
> to create the device, not to do anything with them.
>
> So, I still think the right thing to do is to switch to ccw in the
> tests (and to wire up pci in tcg, but that's an orthogonal issue).
Agree.
>
>

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

* Re: [Qemu-devel] [PATCH 2/3] iotests: use -ccw on s390x for 051
  2017-09-06  7:32     ` Cornelia Huck
@ 2017-09-06  8:42       ` QingFeng Hao
  0 siblings, 0 replies; 20+ messages in thread
From: QingFeng Hao @ 2017-09-06  8:42 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: kwolf, mreitz, qemu-block, qemu-devel, borntraeger, agraf, thuth,
	david, Yi Min Zhao, bjsdjshi



在 2017/9/6 15:32, Cornelia Huck 写道:
> On Wed, 6 Sep 2017 15:19:01 +0800
> QingFeng Hao <haoqf@linux.vnet.ibm.com> wrote:
>
>> 在 2017/9/5 23:16, 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.
>>>
>>> Provide an output file for s390x.
>>>
>>> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
>>> ---
>>>    tests/qemu-iotests/051                     |   9 +-
>>>    tests/qemu-iotests/051.s390-ccw-virtio.out | 434 +++++++++++++++++++++++++++++
>>>    2 files changed, 442 insertions(+), 1 deletion(-)
>>>    create mode 100644 tests/qemu-iotests/051.s390-ccw-virtio.out
>>>
>>> diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
>>> index c8cfc764bc..f6ad0f4f0b 100755
>>> --- a/tests/qemu-iotests/051
>>> +++ b/tests/qemu-iotests/051
>>> @@ -103,7 +103,14 @@ echo
>>>    echo === Device without drive ===
>>>    echo
>>>
>>> -run_qemu -device virtio-scsi-pci -device scsi-hd
>>> +case "$QEMU_DEFAULT_MACHINE" in
>>> +  s390-ccw-virtio)
>>> +      run_qemu -device virtio-scsi-ccw -device scsi-hd
>>> +      ;;
>>> +  *)
>>> +      run_qemu -device virtio-scsi-pci -device scsi-hd
>>> +      ;;
>>> +esac
>>>
>>>    echo
>>>    echo === Overriding backing file ===
>> Regarding the new output file, I have a doubt that why there is no
>> change on "check"
>> script where the result check is located:
>> if diff -w "$reference" $tmp.out >/dev/null 2>&1
Got it. It makes sense.
> The right output reference should be picked as of
>
> commit e166b4148208656635ea2fe39df8b1e875a34fb8
> Author: Bo Tu <tubo@linux.vnet.ibm.com>
> Date:   Fri Jul 3 15:28:46 2015 +0800
>
>      qemu-iotests: qemu machine type support
>      
>      This patch adds qemu machine type support to the io test suite.
>      Based on the qemu default machine type and alias of the default machine
>      type the reference output file can now vary from the default to a
>      machine specific output file if necessary. When using a machine specific
>      reference file if the default machine has an alias then use the alias as the output
>      file name otherwise use the default machine name as the output file name.
>      
>      Reviewed-by: Max Reitz <mreitz@redhat.com>
>      Reviewed-by: Michael Mueller <mimu@linux.vnet.ibm.com>
>      Reviewed-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
>      Signed-off-by: Xiao Guang Chen <chenxg@linux.vnet.ibm.com>
>      Signed-off-by: Kevin Wolf <kwolf@redhat.com>
>

-- 
Regards
QingFeng Hao

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

* Re: [Qemu-devel] [PATCH 2/3] iotests: use -ccw on s390x for 051
  2017-09-05 15:16 ` [Qemu-devel] [PATCH 2/3] iotests: use -ccw on s390x for 051 Cornelia Huck
  2017-09-06  7:19   ` QingFeng Hao
@ 2017-09-08 11:04   ` Kevin Wolf
  2017-09-08 11:24     ` Cornelia Huck
  1 sibling, 1 reply; 20+ messages in thread
From: Kevin Wolf @ 2017-09-08 11:04 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: mreitz, qemu-block, qemu-devel, borntraeger, agraf, thuth, david, haoqf

Am 05.09.2017 um 17:16 hat Cornelia Huck geschrieben:
> 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.
> 
> Provide an output file for s390x.
> 
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>  tests/qemu-iotests/051                     |   9 +-
>  tests/qemu-iotests/051.s390-ccw-virtio.out | 434 +++++++++++++++++++++++++++++
>  2 files changed, 442 insertions(+), 1 deletion(-)
>  create mode 100644 tests/qemu-iotests/051.s390-ccw-virtio.out

It's already a pain to have two separate output files for 051, let's try
to avoid adding a third one. Even more so since I think that the split
between 051.out and 051.pc.out was already made for s390, so I'm not
sure if anyone would actually still make use of the plain 051.out
output if s390 got it's own one.

> diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
> index c8cfc764bc..f6ad0f4f0b 100755
> --- a/tests/qemu-iotests/051
> +++ b/tests/qemu-iotests/051
> @@ -103,7 +103,14 @@ echo
>  echo === Device without drive ===
>  echo
>  
> -run_qemu -device virtio-scsi-pci -device scsi-hd
> +case "$QEMU_DEFAULT_MACHINE" in
> +  s390-ccw-virtio)
> +      run_qemu -device virtio-scsi-ccw -device scsi-hd
> +      ;;
> +  *)
> +      run_qemu -device virtio-scsi-pci -device scsi-hd
> +      ;;
> +esac

The only real difference between 051.out and 051.s390-ccw-virtio.out is
in this one command line. So if we don't want to just skip this part of
the test for non-pc like we already skip ther parts, we generally solve
this kind of thing by just filtering out strings that differ between
setups.

For example:

    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/"

Kevin

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

* Re: [Qemu-devel] [PATCH 3/3] iotests: use -ccw on s390x for 067
  2017-09-05 15:16 ` [Qemu-devel] [PATCH 3/3] iotests: use -ccw on s390x for 067 Cornelia Huck
@ 2017-09-08 11:06   ` Kevin Wolf
  0 siblings, 0 replies; 20+ messages in thread
From: Kevin Wolf @ 2017-09-08 11:06 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: mreitz, qemu-block, qemu-devel, borntraeger, agraf, thuth, david, haoqf

Am 05.09.2017 um 17:16 hat Cornelia Huck geschrieben:
> 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.
> 
> Provide an output file for s390x.
> 
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>

The same argument as for patch 2 applies here, except that 067 has a
single output file so far, so keeping it this way is even more
important. You can again just filter the output.

Kevin

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

* Re: [Qemu-devel] [PATCH 1/3] iotests: use -ccw on s390x for 040, 139, and 182
  2017-09-05 15:16 ` [Qemu-devel] [PATCH 1/3] iotests: use -ccw on s390x for 040, 139, and 182 Cornelia Huck
@ 2017-09-08 11:07   ` Kevin Wolf
  0 siblings, 0 replies; 20+ messages in thread
From: Kevin Wolf @ 2017-09-08 11:07 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: mreitz, qemu-block, qemu-devel, borntraeger, agraf, thuth, david, haoqf

Am 05.09.2017 um 17:16 hat Cornelia Huck geschrieben:
> 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>

Reviewed-by: Kevin Wolf <kwolf@redhat.com>

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

* Re: [Qemu-devel] [PATCH 2/3] iotests: use -ccw on s390x for 051
  2017-09-08 11:04   ` Kevin Wolf
@ 2017-09-08 11:24     ` Cornelia Huck
  2017-09-08 11:54       ` Kevin Wolf
  0 siblings, 1 reply; 20+ messages in thread
From: Cornelia Huck @ 2017-09-08 11:24 UTC (permalink / raw)
  To: Kevin Wolf
  Cc: mreitz, qemu-block, qemu-devel, borntraeger, agraf, thuth, david, haoqf

On Fri, 8 Sep 2017 13:04:25 +0200
Kevin Wolf <kwolf@redhat.com> wrote:

> Am 05.09.2017 um 17:16 hat Cornelia Huck geschrieben:
> > 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.
> > 
> > Provide an output file for s390x.
> > 
> > Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> > ---
> >  tests/qemu-iotests/051                     |   9 +-
> >  tests/qemu-iotests/051.s390-ccw-virtio.out | 434 +++++++++++++++++++++++++++++
> >  2 files changed, 442 insertions(+), 1 deletion(-)
> >  create mode 100644 tests/qemu-iotests/051.s390-ccw-virtio.out  
> 
> It's already a pain to have two separate output files for 051, let's try
> to avoid adding a third one. Even more so since I think that the split
> between 051.out and 051.pc.out was already made for s390, so I'm not
> sure if anyone would actually still make use of the plain 051.out
> output if s390 got it's own one.

Are there no non-pc and non-s390 machines for which this is run?

> 
> > diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
> > index c8cfc764bc..f6ad0f4f0b 100755
> > --- a/tests/qemu-iotests/051
> > +++ b/tests/qemu-iotests/051
> > @@ -103,7 +103,14 @@ echo
> >  echo === Device without drive ===
> >  echo
> >  
> > -run_qemu -device virtio-scsi-pci -device scsi-hd
> > +case "$QEMU_DEFAULT_MACHINE" in
> > +  s390-ccw-virtio)
> > +      run_qemu -device virtio-scsi-ccw -device scsi-hd
> > +      ;;
> > +  *)
> > +      run_qemu -device virtio-scsi-pci -device scsi-hd
> > +      ;;
> > +esac  
> 
> The only real difference between 051.out and 051.s390-ccw-virtio.out is
> in this one command line. So if we don't want to just skip this part of
> the test for non-pc like we already skip ther parts, 

I don't think there's a reason to skip this: The only difference is
that we (currently) don't have a by-default usable virtio-pci
implementation on s390 - but any virtio transport should do.

Another approach would be to drop the -pci postfix, but I don't want to
introduce more usage of aliases.

> we generally solve
> this kind of thing by just filtering out strings that differ between
> setups.
> 
> For example:
> 
>     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/"

Yes, I can try this.

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

* Re: [Qemu-devel] [PATCH 2/3] iotests: use -ccw on s390x for 051
  2017-09-08 11:24     ` Cornelia Huck
@ 2017-09-08 11:54       ` Kevin Wolf
  2017-09-08 15:55         ` Thomas Huth
  0 siblings, 1 reply; 20+ messages in thread
From: Kevin Wolf @ 2017-09-08 11:54 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: mreitz, qemu-block, qemu-devel, borntraeger, agraf, thuth, david, haoqf

Am 08.09.2017 um 13:24 hat Cornelia Huck geschrieben:
> On Fri, 8 Sep 2017 13:04:25 +0200
> Kevin Wolf <kwolf@redhat.com> wrote:
> 
> > Am 05.09.2017 um 17:16 hat Cornelia Huck geschrieben:
> > > 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.
> > > 
> > > Provide an output file for s390x.
> > > 
> > > Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> > > ---
> > >  tests/qemu-iotests/051                     |   9 +-
> > >  tests/qemu-iotests/051.s390-ccw-virtio.out | 434 +++++++++++++++++++++++++++++
> > >  2 files changed, 442 insertions(+), 1 deletion(-)
> > >  create mode 100644 tests/qemu-iotests/051.s390-ccw-virtio.out  
> > 
> > It's already a pain to have two separate output files for 051, let's try
> > to avoid adding a third one. Even more so since I think that the split
> > between 051.out and 051.pc.out was already made for s390, so I'm not
> > sure if anyone would actually still make use of the plain 051.out
> > output if s390 got it's own one.
> 
> Are there no non-pc and non-s390 machines for which this is run?

Who knows? But I'm not aware of anyone who is interested in something
else and has contributed to the test cases until now.

> > > diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
> > > index c8cfc764bc..f6ad0f4f0b 100755
> > > --- a/tests/qemu-iotests/051
> > > +++ b/tests/qemu-iotests/051
> > > @@ -103,7 +103,14 @@ echo
> > >  echo === Device without drive ===
> > >  echo
> > >  
> > > -run_qemu -device virtio-scsi-pci -device scsi-hd
> > > +case "$QEMU_DEFAULT_MACHINE" in
> > > +  s390-ccw-virtio)
> > > +      run_qemu -device virtio-scsi-ccw -device scsi-hd
> > > +      ;;
> > > +  *)
> > > +      run_qemu -device virtio-scsi-pci -device scsi-hd
> > > +      ;;
> > > +esac  
> > 
> > The only real difference between 051.out and 051.s390-ccw-virtio.out is
> > in this one command line. So if we don't want to just skip this part of
> > the test for non-pc like we already skip ther parts, 
> 
> I don't think there's a reason to skip this: The only difference is
> that we (currently) don't have a by-default usable virtio-pci
> implementation on s390 - but any virtio transport should do.

Well, any SCSI controller should do, really. Or in fact, any block
device that doesn't have removable media.

I agree that there's no real reason to skip the test for s390. On the
other hand, testing it on s390 doesn't really contribute anything to the
test coverage as long as the suite is run for PC, too (because there is
nothing machine dependent in the tested code path), so not running it
would be tolerable.

> Another approach would be to drop the -pci postfix, but I don't want to
> introduce more usage of aliases.

Maybe that would indeed be the easiest way. As long as we don't intend
to remove the alias from qemu, there's no reason not to use it in tests.

> > we generally solve
> > this kind of thing by just filtering out strings that differ between
> > setups.
> > 
> > For example:
> > 
> >     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/"
> 
> Yes, I can try this.

Kevin

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

* Re: [Qemu-devel] [PATCH 2/3] iotests: use -ccw on s390x for 051
  2017-09-08 11:54       ` Kevin Wolf
@ 2017-09-08 15:55         ` Thomas Huth
  2017-09-11 10:29           ` Lukáš Doktor
  2017-09-12 16:05           ` Cornelia Huck
  0 siblings, 2 replies; 20+ messages in thread
From: Thomas Huth @ 2017-09-08 15:55 UTC (permalink / raw)
  To: Kevin Wolf, Cornelia Huck
  Cc: haoqf, qemu-block, david, agraf, qemu-devel, borntraeger, mreitz,
	Lukáš Doktor

On 08.09.2017 13:54, Kevin Wolf wrote:
> Am 08.09.2017 um 13:24 hat Cornelia Huck geschrieben:
>> On Fri, 8 Sep 2017 13:04:25 +0200
>> Kevin Wolf <kwolf@redhat.com> wrote:
>>
>>> Am 05.09.2017 um 17:16 hat Cornelia Huck geschrieben:
>>>> 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.
>>>>
>>>> Provide an output file for s390x.
>>>>
>>>> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
>>>> ---
>>>>  tests/qemu-iotests/051                     |   9 +-
>>>>  tests/qemu-iotests/051.s390-ccw-virtio.out | 434 +++++++++++++++++++++++++++++
>>>>  2 files changed, 442 insertions(+), 1 deletion(-)
>>>>  create mode 100644 tests/qemu-iotests/051.s390-ccw-virtio.out  
>>>
>>> It's already a pain to have two separate output files for 051, let's try
>>> to avoid adding a third one. Even more so since I think that the split
>>> between 051.out and 051.pc.out was already made for s390, so I'm not
>>> sure if anyone would actually still make use of the plain 051.out
>>> output if s390 got it's own one.
>>
>> Are there no non-pc and non-s390 machines for which this is run?
> 
> Who knows? But I'm not aware of anyone who is interested in something
> else and has contributed to the test cases until now.

FWIW, as far as I know, Lukáš is running this test also on ppc64 in our
weekly regression run. So it would be good to keep that working, please :-)

>> Another approach would be to drop the -pci postfix, but I don't want to
>> introduce more usage of aliases.
> 
> Maybe that would indeed be the easiest way. As long as we don't intend
> to remove the alias from qemu, there's no reason not to use it in tests.

Maybe we should even use it in a couple of places on purpose - so we get
some test coverage for them?

 Thomas

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

* Re: [Qemu-devel] [PATCH 2/3] iotests: use -ccw on s390x for 051
  2017-09-08 15:55         ` Thomas Huth
@ 2017-09-11 10:29           ` Lukáš Doktor
  2017-09-12 16:05           ` Cornelia Huck
  1 sibling, 0 replies; 20+ messages in thread
From: Lukáš Doktor @ 2017-09-11 10:29 UTC (permalink / raw)
  To: Thomas Huth, Kevin Wolf, Cornelia Huck
  Cc: haoqf, qemu-block, david, agraf, qemu-devel, borntraeger, mreitz

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

Dne 8.9.2017 v 17:55 Thomas Huth napsal(a):
> On 08.09.2017 13:54, Kevin Wolf wrote:
>> Am 08.09.2017 um 13:24 hat Cornelia Huck geschrieben:
>>> On Fri, 8 Sep 2017 13:04:25 +0200
>>> Kevin Wolf <kwolf@redhat.com> wrote:
>>>
>>>> Am 05.09.2017 um 17:16 hat Cornelia Huck geschrieben:
>>>>> 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.
>>>>>
>>>>> Provide an output file for s390x.
>>>>>
>>>>> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
>>>>> ---
>>>>>  tests/qemu-iotests/051                     |   9 +-
>>>>>  tests/qemu-iotests/051.s390-ccw-virtio.out | 434 +++++++++++++++++++++++++++++
>>>>>  2 files changed, 442 insertions(+), 1 deletion(-)
>>>>>  create mode 100644 tests/qemu-iotests/051.s390-ccw-virtio.out  
>>>>
>>>> It's already a pain to have two separate output files for 051, let's try
>>>> to avoid adding a third one. Even more so since I think that the split
>>>> between 051.out and 051.pc.out was already made for s390, so I'm not
>>>> sure if anyone would actually still make use of the plain 051.out
>>>> output if s390 got it's own one.
>>>
>>> Are there no non-pc and non-s390 machines for which this is run?
>>
>> Who knows? But I'm not aware of anyone who is interested in something
>> else and has contributed to the test cases until now.
> 
> FWIW, as far as I know, Lukáš is running this test also on ppc64 in our
> weekly regression run. So it would be good to keep that working, please :-)
> 

Yes, works well on ppc64(le) and would be nice to keep it that way...

Lukáš

>>> Another approach would be to drop the -pci postfix, but I don't want to
>>> introduce more usage of aliases.
>>
>> Maybe that would indeed be the easiest way. As long as we don't intend
>> to remove the alias from qemu, there's no reason not to use it in tests.
> 
> Maybe we should even use it in a couple of places on purpose - so we get
> some test coverage for them?
> 
>  Thomas
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 502 bytes --]

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

* Re: [Qemu-devel] [PATCH 2/3] iotests: use -ccw on s390x for 051
  2017-09-08 15:55         ` Thomas Huth
  2017-09-11 10:29           ` Lukáš Doktor
@ 2017-09-12 16:05           ` Cornelia Huck
  2017-09-12 16:16             ` Kevin Wolf
  1 sibling, 1 reply; 20+ messages in thread
From: Cornelia Huck @ 2017-09-12 16:05 UTC (permalink / raw)
  To: Thomas Huth
  Cc: Kevin Wolf, haoqf, qemu-block, david, agraf, qemu-devel,
	borntraeger, mreitz, Lukáš Doktor

On Fri, 8 Sep 2017 17:55:29 +0200
Thomas Huth <thuth@redhat.com> wrote:

> On 08.09.2017 13:54, Kevin Wolf wrote:
> > Am 08.09.2017 um 13:24 hat Cornelia Huck geschrieben:  
> >> On Fri, 8 Sep 2017 13:04:25 +0200
> >> Kevin Wolf <kwolf@redhat.com> wrote:
> >>  
> >>> Am 05.09.2017 um 17:16 hat Cornelia Huck geschrieben:  
> >>>> 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.
> >>>>
> >>>> Provide an output file for s390x.
> >>>>
> >>>> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> >>>> ---
> >>>>  tests/qemu-iotests/051                     |   9 +-
> >>>>  tests/qemu-iotests/051.s390-ccw-virtio.out | 434 +++++++++++++++++++++++++++++
> >>>>  2 files changed, 442 insertions(+), 1 deletion(-)
> >>>>  create mode 100644 tests/qemu-iotests/051.s390-ccw-virtio.out    
> >>>
> >>> It's already a pain to have two separate output files for 051, let's try
> >>> to avoid adding a third one. Even more so since I think that the split
> >>> between 051.out and 051.pc.out was already made for s390, so I'm not
> >>> sure if anyone would actually still make use of the plain 051.out
> >>> output if s390 got it's own one.  
> >>
> >> Are there no non-pc and non-s390 machines for which this is run?  
> > 
> > Who knows? But I'm not aware of anyone who is interested in something
> > else and has contributed to the test cases until now.  
> 
> FWIW, as far as I know, Lukáš is running this test also on ppc64 in our
> weekly regression run. So it would be good to keep that working, please :-)
> 
> >> Another approach would be to drop the -pci postfix, but I don't want to
> >> introduce more usage of aliases.  
> > 
> > Maybe that would indeed be the easiest way. As long as we don't intend
> > to remove the alias from qemu, there's no reason not to use it in tests.  
> 
> Maybe we should even use it in a couple of places on purpose - so we get
> some test coverage for them?

FWIW, using the the sed post-run filtering works well for 051, but it
is driving me bonkers on 067 (or maybe I should just call it a day...)

We could use the sed approach for 051 and the alias approach on 067 -
that way we would also test aliases :)

Any preferences by the iotest maintainers?

[I'd be happy if iotests worked again on s390x...]

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

* Re: [Qemu-devel] [PATCH 2/3] iotests: use -ccw on s390x for 051
  2017-09-12 16:05           ` Cornelia Huck
@ 2017-09-12 16:16             ` Kevin Wolf
  0 siblings, 0 replies; 20+ messages in thread
From: Kevin Wolf @ 2017-09-12 16:16 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: Thomas Huth, haoqf, qemu-block, david, agraf, qemu-devel,
	borntraeger, mreitz, Lukáš Doktor

Am 12.09.2017 um 18:05 hat Cornelia Huck geschrieben:
> On Fri, 8 Sep 2017 17:55:29 +0200
> Thomas Huth <thuth@redhat.com> wrote:
> 
> > On 08.09.2017 13:54, Kevin Wolf wrote:
> > > Am 08.09.2017 um 13:24 hat Cornelia Huck geschrieben:  
> > >> On Fri, 8 Sep 2017 13:04:25 +0200
> > >> Kevin Wolf <kwolf@redhat.com> wrote:
> > >>  
> > >>> Am 05.09.2017 um 17:16 hat Cornelia Huck geschrieben:  
> > >>>> 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.
> > >>>>
> > >>>> Provide an output file for s390x.
> > >>>>
> > >>>> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> > >>>> ---
> > >>>>  tests/qemu-iotests/051                     |   9 +-
> > >>>>  tests/qemu-iotests/051.s390-ccw-virtio.out | 434 +++++++++++++++++++++++++++++
> > >>>>  2 files changed, 442 insertions(+), 1 deletion(-)
> > >>>>  create mode 100644 tests/qemu-iotests/051.s390-ccw-virtio.out    
> > >>>
> > >>> It's already a pain to have two separate output files for 051, let's try
> > >>> to avoid adding a third one. Even more so since I think that the split
> > >>> between 051.out and 051.pc.out was already made for s390, so I'm not
> > >>> sure if anyone would actually still make use of the plain 051.out
> > >>> output if s390 got it's own one.  
> > >>
> > >> Are there no non-pc and non-s390 machines for which this is run?  
> > > 
> > > Who knows? But I'm not aware of anyone who is interested in something
> > > else and has contributed to the test cases until now.  
> > 
> > FWIW, as far as I know, Lukáš is running this test also on ppc64 in our
> > weekly regression run. So it would be good to keep that working, please :-)
> > 
> > >> Another approach would be to drop the -pci postfix, but I don't want to
> > >> introduce more usage of aliases.  
> > > 
> > > Maybe that would indeed be the easiest way. As long as we don't intend
> > > to remove the alias from qemu, there's no reason not to use it in tests.  
> > 
> > Maybe we should even use it in a couple of places on purpose - so we get
> > some test coverage for them?
> 
> FWIW, using the the sed post-run filtering works well for 051, but it
> is driving me bonkers on 067 (or maybe I should just call it a day...)
> 
> We could use the sed approach for 051 and the alias approach on 067 -
> that way we would also test aliases :)
> 
> Any preferences by the iotest maintainers?

Sure, that works for me. I'm happy with anything that works and doesn't
split the reference output in two versions. (Not splitting is also in
your own interest; if anything bitrots, it's the non-pc version.)

Kevin

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

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

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-05 15:16 [Qemu-devel] [PATCH 0/3] iotests: cure s390x failures by switching to ccw Cornelia Huck
2017-09-05 15:16 ` [Qemu-devel] [PATCH 1/3] iotests: use -ccw on s390x for 040, 139, and 182 Cornelia Huck
2017-09-08 11:07   ` Kevin Wolf
2017-09-05 15:16 ` [Qemu-devel] [PATCH 2/3] iotests: use -ccw on s390x for 051 Cornelia Huck
2017-09-06  7:19   ` QingFeng Hao
2017-09-06  7:32     ` Cornelia Huck
2017-09-06  8:42       ` QingFeng Hao
2017-09-08 11:04   ` Kevin Wolf
2017-09-08 11:24     ` Cornelia Huck
2017-09-08 11:54       ` Kevin Wolf
2017-09-08 15:55         ` Thomas Huth
2017-09-11 10:29           ` Lukáš Doktor
2017-09-12 16:05           ` Cornelia Huck
2017-09-12 16:16             ` Kevin Wolf
2017-09-05 15:16 ` [Qemu-devel] [PATCH 3/3] iotests: use -ccw on s390x for 067 Cornelia Huck
2017-09-08 11:06   ` Kevin Wolf
2017-09-06  6:57 ` [Qemu-devel] [PATCH 0/3] iotests: cure s390x failures by switching to ccw QingFeng Hao
2017-09-06  7:17   ` Cornelia Huck
2017-09-06  7:59   ` Cornelia Huck
2017-09-06  8:09     ` Yi Min Zhao

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.