All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] iotests: fix failures with non-PCI machines
@ 2021-03-19 13:25 Laurent Vivier
  2021-03-19 13:25 ` [PATCH v2 1/6] qdev: define list of archs with virtio-pci or virtio-ccw Laurent Vivier
                   ` (5 more replies)
  0 siblings, 6 replies; 21+ messages in thread
From: Laurent Vivier @ 2021-03-19 13:25 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Cornelia Huck, Markus Armbruster,
	Max Reitz, qemu-s390x, Paolo Bonzini, Philippe Mathieu-Daudé,
	Laurent Vivier

Tests are executed using virtio-*-pci even on a non PCI machine.

The problem can be easily fixed using the virtio aliases
(virtio-*), to run virtio-*-ccw on s390x and virtio-*-device on
m68k.

A first attempt was tried with virtio-*-ccw by detecting
the machine type, this series removes it to use the aliases that
are a cleaner approach.

v2:
   Fix typos and comments
   Don't define QEMU_ARCH_NO_PCI but QEMU_ARCH_VIRTIO_PCI,
   QEMU_ARCH_VIRTIO_CCW and QEMU_ARCH_VIRTIO_MMIO
   Update test 127 and 256 to run with ccw
   Update .out of test 051
   Add a patch to update "-drive if=virtio"

Laurent Vivier (6):
  qdev: define list of archs with virtio-pci or virtio-ccw
  m68k: add the virtio devices aliases
  blockdev: with -drive if=virtio, use generic virtio-blk
  iotests: Revert "iotests: use -ccw on s390x for 040, 139, and 182"
  iotests: test m68k with the virt machine
  iotests: iothreads need ioeventfd

 include/sysemu/arch_init.h    |  8 +++++
 blockdev.c                    |  6 +---
 softmmu/qdev-monitor.c        | 65 ++++++++++++++++++++---------------
 tests/qemu-iotests/040        |  2 +-
 tests/qemu-iotests/051        | 12 +------
 tests/qemu-iotests/051.out    |  2 +-
 tests/qemu-iotests/051.pc.out |  2 +-
 tests/qemu-iotests/068        |  4 +--
 tests/qemu-iotests/093        |  3 +-
 tests/qemu-iotests/127        |  3 +-
 tests/qemu-iotests/139        |  9 ++---
 tests/qemu-iotests/182        | 13 ++-----
 tests/qemu-iotests/238        |  4 +--
 tests/qemu-iotests/240        | 10 +++---
 tests/qemu-iotests/256        |  6 ++--
 tests/qemu-iotests/257        |  4 +--
 tests/qemu-iotests/307        |  4 +--
 tests/qemu-iotests/iotests.py | 10 +++---
 tests/qemu-iotests/testenv.py |  1 +
 19 files changed, 77 insertions(+), 91 deletions(-)

-- 
2.30.2



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

* [PATCH v2 1/6] qdev: define list of archs with virtio-pci or virtio-ccw
  2021-03-19 13:25 [PATCH v2 0/6] iotests: fix failures with non-PCI machines Laurent Vivier
@ 2021-03-19 13:25 ` Laurent Vivier
  2021-03-19 14:40   ` Cornelia Huck
  2021-03-19 13:25 ` [PATCH v2 2/6] m68k: add the virtio devices aliases Laurent Vivier
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 21+ messages in thread
From: Laurent Vivier @ 2021-03-19 13:25 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Cornelia Huck, Markus Armbruster,
	Max Reitz, qemu-s390x, Paolo Bonzini, Philippe Mathieu-Daudé,
	Laurent Vivier

This is used to define virtio-*-pci and virtio-*-ccw aliases
rather than substracting the CCW architecture from all the others.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 include/sysemu/arch_init.h |  7 +++++
 softmmu/qdev-monitor.c     | 53 ++++++++++++++++++--------------------
 2 files changed, 32 insertions(+), 28 deletions(-)

diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h
index 54f069d49126..7217a822a14b 100644
--- a/include/sysemu/arch_init.h
+++ b/include/sysemu/arch_init.h
@@ -35,4 +35,11 @@ extern const uint32_t arch_type;
 int kvm_available(void);
 int xen_available(void);
 
+#define QEMU_ARCH_VIRTIO_PCI (QEMU_ARCH_ALPHA | QEMU_ARCH_ARM | \
+                              QEMU_ARCH_HPPA | QEMU_ARCH_I386 | \
+                              QEMU_ARCH_MIPS | QEMU_ARCH_PPC |  \
+                              QEMU_ARCH_RISCV | QEMU_ARCH_SH4 | \
+                              QEMU_ARCH_SPARC | QEMU_ARCH_XTENSA)
+#define QEMU_ARCH_VIRTIO_CCW (QEMU_ARCH_S390X)
+
 #endif
diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c
index 8dc656becca9..0b40c97c6e50 100644
--- a/softmmu/qdev-monitor.c
+++ b/softmmu/qdev-monitor.c
@@ -60,34 +60,31 @@ static const QDevAlias qdev_alias_table[] = {
     { "ES1370", "es1370" }, /* -soundhw name */
     { "ich9-ahci", "ahci" },
     { "lsi53c895a", "lsi" },
-    { "virtio-9p-ccw", "virtio-9p", QEMU_ARCH_S390X },
-    { "virtio-9p-pci", "virtio-9p", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
-    { "virtio-balloon-ccw", "virtio-balloon", QEMU_ARCH_S390X },
-    { "virtio-balloon-pci", "virtio-balloon",
-            QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
-    { "virtio-blk-ccw", "virtio-blk", QEMU_ARCH_S390X },
-    { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
-    { "virtio-gpu-ccw", "virtio-gpu", QEMU_ARCH_S390X },
-    { "virtio-gpu-pci", "virtio-gpu", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
-    { "virtio-input-host-ccw", "virtio-input-host", QEMU_ARCH_S390X },
-    { "virtio-input-host-pci", "virtio-input-host",
-            QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
-    { "virtio-iommu-pci", "virtio-iommu", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
-    { "virtio-keyboard-ccw", "virtio-keyboard", QEMU_ARCH_S390X },
-    { "virtio-keyboard-pci", "virtio-keyboard",
-            QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
-    { "virtio-mouse-ccw", "virtio-mouse", QEMU_ARCH_S390X },
-    { "virtio-mouse-pci", "virtio-mouse", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
-    { "virtio-net-ccw", "virtio-net", QEMU_ARCH_S390X },
-    { "virtio-net-pci", "virtio-net", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
-    { "virtio-rng-ccw", "virtio-rng", QEMU_ARCH_S390X },
-    { "virtio-rng-pci", "virtio-rng", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
-    { "virtio-scsi-ccw", "virtio-scsi", QEMU_ARCH_S390X },
-    { "virtio-scsi-pci", "virtio-scsi", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
-    { "virtio-serial-ccw", "virtio-serial", QEMU_ARCH_S390X },
-    { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
-    { "virtio-tablet-ccw", "virtio-tablet", QEMU_ARCH_S390X },
-    { "virtio-tablet-pci", "virtio-tablet", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
+    { "virtio-9p-ccw", "virtio-9p", QEMU_ARCH_VIRTIO_CCW },
+    { "virtio-9p-pci", "virtio-9p", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-balloon-ccw", "virtio-balloon", QEMU_ARCH_VIRTIO_CCW },
+    { "virtio-balloon-pci", "virtio-balloon", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-blk-ccw", "virtio-blk", QEMU_ARCH_VIRTIO_CCW },
+    { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-gpu-ccw", "virtio-gpu", QEMU_ARCH_VIRTIO_CCW },
+    { "virtio-gpu-pci", "virtio-gpu", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-input-host-ccw", "virtio-input-host", QEMU_ARCH_VIRTIO_CCW },
+    { "virtio-input-host-pci", "virtio-input-host", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-iommu-pci", "virtio-iommu", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-keyboard-ccw", "virtio-keyboard", QEMU_ARCH_VIRTIO_CCW },
+    { "virtio-keyboard-pci", "virtio-keyboard", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-mouse-ccw", "virtio-mouse", QEMU_ARCH_VIRTIO_CCW },
+    { "virtio-mouse-pci", "virtio-mouse", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-net-ccw", "virtio-net", QEMU_ARCH_VIRTIO_CCW },
+    { "virtio-net-pci", "virtio-net", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-rng-ccw", "virtio-rng", QEMU_ARCH_VIRTIO_CCW },
+    { "virtio-rng-pci", "virtio-rng", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-scsi-ccw", "virtio-scsi", QEMU_ARCH_VIRTIO_CCW },
+    { "virtio-scsi-pci", "virtio-scsi", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-serial-ccw", "virtio-serial", QEMU_ARCH_VIRTIO_CCW },
+    { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_VIRTIO_PCI},
+    { "virtio-tablet-ccw", "virtio-tablet", QEMU_ARCH_VIRTIO_CCW },
+    { "virtio-tablet-pci", "virtio-tablet", QEMU_ARCH_VIRTIO_PCI },
     { }
 };
 
-- 
2.30.2



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

* [PATCH v2 2/6] m68k: add the virtio devices aliases
  2021-03-19 13:25 [PATCH v2 0/6] iotests: fix failures with non-PCI machines Laurent Vivier
  2021-03-19 13:25 ` [PATCH v2 1/6] qdev: define list of archs with virtio-pci or virtio-ccw Laurent Vivier
@ 2021-03-19 13:25 ` Laurent Vivier
  2021-03-19 13:33   ` Philippe Mathieu-Daudé
  2021-03-19 14:41   ` Cornelia Huck
  2021-03-19 13:25 ` [PATCH v2 3/6] blockdev: with -drive if=virtio, use generic virtio-blk Laurent Vivier
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 21+ messages in thread
From: Laurent Vivier @ 2021-03-19 13:25 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Cornelia Huck, Markus Armbruster,
	Max Reitz, qemu-s390x, Paolo Bonzini, Philippe Mathieu-Daudé,
	Laurent Vivier

Similarly to 5f629d943cb0 ("s390x: fix s390 virtio aliases"),
define the virtio aliases.

This allows to start machines with virtio devices without
knowledge of the implementation type.

For instance, we can use "-device virtio-scsi" on
m68k, s390x or PC, and the device will be respectively
"virtio-scsi-device", "virtio-scsi-ccw" or "virtio-scsi-pci".

This already exists for s390x and -ccw interfaces, add them
for m68k and MMIO (-device) interfaces.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 include/sysemu/arch_init.h |  1 +
 softmmu/qdev-monitor.c     | 12 ++++++++++++
 2 files changed, 13 insertions(+)

diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h
index 7217a822a14b..c6e34124e8a3 100644
--- a/include/sysemu/arch_init.h
+++ b/include/sysemu/arch_init.h
@@ -41,5 +41,6 @@ int xen_available(void);
                               QEMU_ARCH_RISCV | QEMU_ARCH_SH4 | \
                               QEMU_ARCH_SPARC | QEMU_ARCH_XTENSA)
 #define QEMU_ARCH_VIRTIO_CCW (QEMU_ARCH_S390X)
+#define QEMU_ARCH_VIRTIO_MMIO (QEMU_ARCH_M68K)
 
 #endif
diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c
index 0b40c97c6e50..a9955b97a078 100644
--- a/softmmu/qdev-monitor.c
+++ b/softmmu/qdev-monitor.c
@@ -60,29 +60,41 @@ static const QDevAlias qdev_alias_table[] = {
     { "ES1370", "es1370" }, /* -soundhw name */
     { "ich9-ahci", "ahci" },
     { "lsi53c895a", "lsi" },
+    { "virtio-9p-device", "virtio-9p", QEMU_ARCH_VIRTIO_MMIO },
     { "virtio-9p-ccw", "virtio-9p", QEMU_ARCH_VIRTIO_CCW },
     { "virtio-9p-pci", "virtio-9p", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-balloon-device", "virtio-balloon", QEMU_ARCH_VIRTIO_MMIO },
     { "virtio-balloon-ccw", "virtio-balloon", QEMU_ARCH_VIRTIO_CCW },
     { "virtio-balloon-pci", "virtio-balloon", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-blk-device", "virtio-blk", QEMU_ARCH_VIRTIO_MMIO },
     { "virtio-blk-ccw", "virtio-blk", QEMU_ARCH_VIRTIO_CCW },
     { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-gpu-device", "virtio-gpu", QEMU_ARCH_VIRTIO_MMIO },
     { "virtio-gpu-ccw", "virtio-gpu", QEMU_ARCH_VIRTIO_CCW },
     { "virtio-gpu-pci", "virtio-gpu", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-input-host-device", "virtio-input-host", QEMU_ARCH_VIRTIO_MMIO },
     { "virtio-input-host-ccw", "virtio-input-host", QEMU_ARCH_VIRTIO_CCW },
     { "virtio-input-host-pci", "virtio-input-host", QEMU_ARCH_VIRTIO_PCI },
     { "virtio-iommu-pci", "virtio-iommu", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-keyboard-device", "virtio-keyboard", QEMU_ARCH_VIRTIO_MMIO },
     { "virtio-keyboard-ccw", "virtio-keyboard", QEMU_ARCH_VIRTIO_CCW },
     { "virtio-keyboard-pci", "virtio-keyboard", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-mouse-device", "virtio-mouse", QEMU_ARCH_VIRTIO_MMIO },
     { "virtio-mouse-ccw", "virtio-mouse", QEMU_ARCH_VIRTIO_CCW },
     { "virtio-mouse-pci", "virtio-mouse", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-net-device", "virtio-net", QEMU_ARCH_VIRTIO_MMIO },
     { "virtio-net-ccw", "virtio-net", QEMU_ARCH_VIRTIO_CCW },
     { "virtio-net-pci", "virtio-net", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-rng-device", "virtio-rng", QEMU_ARCH_VIRTIO_MMIO },
     { "virtio-rng-ccw", "virtio-rng", QEMU_ARCH_VIRTIO_CCW },
     { "virtio-rng-pci", "virtio-rng", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-scsi-device", "virtio-scsi", QEMU_ARCH_VIRTIO_MMIO },
     { "virtio-scsi-ccw", "virtio-scsi", QEMU_ARCH_VIRTIO_CCW },
     { "virtio-scsi-pci", "virtio-scsi", QEMU_ARCH_VIRTIO_PCI },
+    { "virtio-serial-device", "virtio-serial", QEMU_ARCH_VIRTIO_MMIO },
     { "virtio-serial-ccw", "virtio-serial", QEMU_ARCH_VIRTIO_CCW },
     { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_VIRTIO_PCI},
+    { "virtio-tablet-device", "virtio-tablet", QEMU_ARCH_VIRTIO_MMIO },
     { "virtio-tablet-ccw", "virtio-tablet", QEMU_ARCH_VIRTIO_CCW },
     { "virtio-tablet-pci", "virtio-tablet", QEMU_ARCH_VIRTIO_PCI },
     { }
-- 
2.30.2



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

* [PATCH v2 3/6] blockdev: with -drive if=virtio, use generic virtio-blk
  2021-03-19 13:25 [PATCH v2 0/6] iotests: fix failures with non-PCI machines Laurent Vivier
  2021-03-19 13:25 ` [PATCH v2 1/6] qdev: define list of archs with virtio-pci or virtio-ccw Laurent Vivier
  2021-03-19 13:25 ` [PATCH v2 2/6] m68k: add the virtio devices aliases Laurent Vivier
@ 2021-03-19 13:25 ` Laurent Vivier
  2021-03-19 13:36   ` Philippe Mathieu-Daudé
  2021-03-19 14:46   ` Cornelia Huck
  2021-03-19 13:25 ` [PATCH v2 4/6] iotests: Revert "iotests: use -ccw on s390x for 040, 139, and 182" Laurent Vivier
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 21+ messages in thread
From: Laurent Vivier @ 2021-03-19 13:25 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Cornelia Huck, Markus Armbruster,
	Max Reitz, qemu-s390x, Paolo Bonzini, Philippe Mathieu-Daudé,
	Laurent Vivier

Rather than checking if the machine is an s390x to use virtio-blk-ccw
instead of virtio-blk-pci, use the alias virtio-blk that is set to
the expected target.

This also enables the use of virtio-blk-device for targets without
PCI or CCW.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 blockdev.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index 5cc7c7effe9f..64da5350e3ad 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -969,11 +969,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
         QemuOpts *devopts;
         devopts = qemu_opts_create(qemu_find_opts("device"), NULL, 0,
                                    &error_abort);
-        if (arch_type == QEMU_ARCH_S390X) {
-            qemu_opt_set(devopts, "driver", "virtio-blk-ccw", &error_abort);
-        } else {
-            qemu_opt_set(devopts, "driver", "virtio-blk-pci", &error_abort);
-        }
+        qemu_opt_set(devopts, "driver", "virtio-blk", &error_abort);
         qemu_opt_set(devopts, "drive", qdict_get_str(bs_opts, "id"),
                      &error_abort);
     }
-- 
2.30.2



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

* [PATCH v2 4/6] iotests: Revert "iotests: use -ccw on s390x for 040, 139, and 182"
  2021-03-19 13:25 [PATCH v2 0/6] iotests: fix failures with non-PCI machines Laurent Vivier
                   ` (2 preceding siblings ...)
  2021-03-19 13:25 ` [PATCH v2 3/6] blockdev: with -drive if=virtio, use generic virtio-blk Laurent Vivier
@ 2021-03-19 13:25 ` Laurent Vivier
  2021-03-19 13:42   ` Philippe Mathieu-Daudé
  2021-03-19 14:49   ` Cornelia Huck
  2021-03-19 13:25 ` [PATCH v2 5/6] iotests: test m68k with the virt machine Laurent Vivier
  2021-03-19 13:25 ` [PATCH v2 6/6] iotests: iothreads need ioeventfd Laurent Vivier
  5 siblings, 2 replies; 21+ messages in thread
From: Laurent Vivier @ 2021-03-19 13:25 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Cornelia Huck, Markus Armbruster,
	Max Reitz, qemu-s390x, Paolo Bonzini, Philippe Mathieu-Daudé,
	Laurent Vivier

Commit f1d5516ab583 introduces a test in some iotests to check if
the machine is a s390-ccw-virtio and to select virtio-*-ccw rather
than virtio-*-pci.

We don't need that because QEMU already provides aliases to use the correct
virtio interface according to the machine type.

This patch removes all virtio-*-pci and virtio-*-ccw to use virtio-*
instead. This also enables virtio-mmio devices (virtio-*-device)

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
cc: Cornelia Huck <cohuck@redhat.com>
---
 tests/qemu-iotests/040        |  2 +-
 tests/qemu-iotests/051        | 12 +-----------
 tests/qemu-iotests/051.out    |  2 +-
 tests/qemu-iotests/051.pc.out |  2 +-
 tests/qemu-iotests/068        |  4 +---
 tests/qemu-iotests/093        |  3 +--
 tests/qemu-iotests/139        |  9 ++-------
 tests/qemu-iotests/182        | 13 ++-----------
 tests/qemu-iotests/238        |  4 +---
 tests/qemu-iotests/240        | 10 +++++-----
 tests/qemu-iotests/257        |  4 ++--
 tests/qemu-iotests/307        |  4 +---
 tests/qemu-iotests/iotests.py |  5 -----
 13 files changed, 19 insertions(+), 55 deletions(-)

diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040
index 336ff7c4f2ab..ba7cb34ce8cf 100755
--- a/tests/qemu-iotests/040
+++ b/tests/qemu-iotests/040
@@ -89,7 +89,7 @@ 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(iotests.get_virtio_scsi_device())
+        self.vm.add_device('virtio-scsi')
         self.vm.add_device("scsi-hd,id=scsi0,drive=drive0")
         self.vm.launch()
         self.has_quit = False
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index 7cbd1415ce7b..00382cc55e25 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -119,17 +119,7 @@ echo
 echo === Device without drive ===
 echo
 
-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/"
+run_qemu -device virtio-scsi -device scsi-hd
 
 echo
 echo === Overriding backing file ===
diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out
index de4771bcb36d..437053c8395c 100644
--- a/tests/qemu-iotests/051.out
+++ b/tests/qemu-iotests/051.out
@@ -72,7 +72,7 @@ QEMU_PROG: -drive file=TEST_DIR/t.qcow2,node-name=foo#12: Invalid node name
 
 === Device without drive ===
 
-Testing: -device VIRTIO_SCSI -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 f570610f645f..c4e011369809 100644
--- a/tests/qemu-iotests/051.pc.out
+++ b/tests/qemu-iotests/051.pc.out
@@ -72,7 +72,7 @@ QEMU_PROG: -drive file=TEST_DIR/t.qcow2,node-name=foo#12: Invalid node-name: 'fo
 
 === Device without drive ===
 
-Testing: -device VIRTIO_SCSI -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/068 b/tests/qemu-iotests/068
index 03e03508a6e2..54e49c8ffab1 100755
--- a/tests/qemu-iotests/068
+++ b/tests/qemu-iotests/068
@@ -49,11 +49,9 @@ IMG_SIZE=128K
 case "$QEMU_DEFAULT_MACHINE" in
   s390-ccw-virtio)
       platform_parm="-no-shutdown"
-      hba=virtio-scsi-ccw
       ;;
   *)
       platform_parm=""
-      hba=virtio-scsi-pci
       ;;
 esac
 
@@ -61,7 +59,7 @@ _qemu()
 {
     $QEMU $platform_parm -nographic -monitor stdio -serial none \
           -drive if=none,id=drive0,file="$TEST_IMG",format="$IMGFMT" \
-          -device $hba,id=hba0 \
+          -device virtio-scsi,id=hba0 \
           -device scsi-hd,drive=drive0 \
           "$@" |\
     _filter_qemu | _filter_hmp
diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093
index 7745cb04b611..93274dc8cbde 100755
--- a/tests/qemu-iotests/093
+++ b/tests/qemu-iotests/093
@@ -371,8 +371,7 @@ class ThrottleTestGroupNames(iotests.QMPTestCase):
 class ThrottleTestRemovableMedia(iotests.QMPTestCase):
     def setUp(self):
         self.vm = iotests.VM()
-        self.vm.add_device("{},id=virtio-scsi".format(
-            iotests.get_virtio_scsi_device()))
+        self.vm.add_device("{},id=virtio-scsi".format('virtio-scsi'))
         self.vm.launch()
 
     def tearDown(self):
diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139
index e79b3c21fdce..178b1ee230ca 100755
--- a/tests/qemu-iotests/139
+++ b/tests/qemu-iotests/139
@@ -26,18 +26,13 @@ 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("{},id=virtio-scsi".format(
-            iotests.get_virtio_scsi_device()))
+        self.vm.add_device("{},id=virtio-scsi".format('virtio-scsi'))
         self.vm.launch()
 
     def tearDown(self):
@@ -93,7 +88,7 @@ class TestBlockdevDel(iotests.QMPTestCase):
         self.checkBlockDriverState(node, expect_error)
 
     # Add a device model
-    def addDeviceModel(self, device, backend, driver = default_virtio_blk):
+    def addDeviceModel(self, device, backend, driver = '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 55a0384c0873..fcd1d796ebd0 100755
--- a/tests/qemu-iotests/182
+++ b/tests/qemu-iotests/182
@@ -46,26 +46,17 @@ _supported_proto file
 
 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 $virtioblk,drive=drive0
+    -device virtio-blk,drive=drive0
 
 echo
 echo "Starting a second QEMU using the same image should fail"
 echo 'quit' | $QEMU -nographic -monitor stdio \
     -drive file=$TEST_IMG,if=none,id=drive0,file.locking=on \
-    -device $virtioblk,drive=drive0 2>&1 | _filter_testdir 2>&1 |
+    -device virtio-blk,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'
diff --git a/tests/qemu-iotests/238 b/tests/qemu-iotests/238
index 8a10af57f17c..38bd3744e68c 100755
--- a/tests/qemu-iotests/238
+++ b/tests/qemu-iotests/238
@@ -26,14 +26,12 @@ from iotests import log
 
 iotests.script_initialize()
 
-virtio_scsi_device = iotests.get_virtio_scsi_device()
-
 vm = iotests.VM()
 vm.launch()
 
 log(vm.qmp('blockdev-add', node_name='hd0', driver='null-co', read_zeroes=True))
 log(vm.qmp('object-add', qom_type='iothread', id='iothread0'))
-log(vm.qmp('device_add', id='scsi0', driver=virtio_scsi_device, iothread='iothread0'))
+log(vm.qmp('device_add', id='scsi0', driver='virtio-scsi', iothread='iothread0'))
 log(vm.qmp('device_add', id='scsi-hd0', driver='scsi-hd', drive='hd0'))
 log(vm.qmp('block_set_io_throttle', id='scsi-hd0', bps=0, bps_rd=0, bps_wr=0,
            iops=1000, iops_rd=0, iops_wr=0, conv_keys=False))
diff --git a/tests/qemu-iotests/240 b/tests/qemu-iotests/240
index ab077f4ceb01..9b281e1dc036 100755
--- a/tests/qemu-iotests/240
+++ b/tests/qemu-iotests/240
@@ -42,7 +42,7 @@ class TestCase(iotests.QMPTestCase):
         iotests.log('==Unplug a SCSI disk and then plug it again==')
         self.vm.qmp_log('blockdev-add', driver='null-co', read_zeroes=True, node_name='hd0')
         self.vm.qmp_log('object-add', qom_type='iothread', id="iothread0")
-        self.vm.qmp_log('device_add', id='scsi0', driver=iotests.get_virtio_scsi_device(), iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi])
+        self.vm.qmp_log('device_add', id='scsi0', driver='virtio-scsi', iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi])
         self.vm.qmp_log('device_add', id='scsi-hd0', driver='scsi-hd', drive='hd0')
         self.vm.qmp_log('device_del', id='scsi-hd0')
         self.vm.event_wait('DEVICE_DELETED')
@@ -55,7 +55,7 @@ class TestCase(iotests.QMPTestCase):
         iotests.log('==Attach two SCSI disks using the same block device and the same iothread==')
         self.vm.qmp_log('blockdev-add', driver='null-co', read_zeroes=True, node_name='hd0', read_only=True)
         self.vm.qmp_log('object-add', qom_type='iothread', id="iothread0")
-        self.vm.qmp_log('device_add', id='scsi0', driver=iotests.get_virtio_scsi_device(), iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi])
+        self.vm.qmp_log('device_add', id='scsi0', driver='virtio-scsi', iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi])
 
         self.vm.qmp_log('device_add', id='scsi-hd0', driver='scsi-hd', drive='hd0')
         self.vm.qmp_log('device_add', id='scsi-hd1', driver='scsi-hd', drive='hd0')
@@ -73,8 +73,8 @@ class TestCase(iotests.QMPTestCase):
         self.vm.qmp_log('object-add', qom_type='iothread', id="iothread0")
         self.vm.qmp_log('object-add', qom_type='iothread', id="iothread1")
 
-        self.vm.qmp_log('device_add', id='scsi0', driver=iotests.get_virtio_scsi_device(), iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi])
-        self.vm.qmp_log('device_add', id='scsi1', driver=iotests.get_virtio_scsi_device(), iothread='iothread1', filters=[iotests.filter_qmp_virtio_scsi])
+        self.vm.qmp_log('device_add', id='scsi0', driver='virtio-scsi', iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi])
+        self.vm.qmp_log('device_add', id='scsi1', driver='virtio-scsi', iothread='iothread1', filters=[iotests.filter_qmp_virtio_scsi])
 
         self.vm.qmp_log('device_add', id='scsi-hd0', driver='scsi-hd', drive='hd0', bus="scsi0.0")
         self.vm.qmp_log('device_add', id='scsi-hd1', driver='scsi-hd', drive='hd0', bus="scsi1.0")
@@ -99,7 +99,7 @@ class TestCase(iotests.QMPTestCase):
         self.vm.qmp_log('nbd-server-add', device='hd0')
 
         self.vm.qmp_log('object-add', qom_type='iothread', id="iothread0")
-        self.vm.qmp_log('device_add', id='scsi0', driver=iotests.get_virtio_scsi_device(), iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi])
+        self.vm.qmp_log('device_add', id='scsi0', driver='virtio-scsi', iothread='iothread0', filters=[iotests.filter_qmp_virtio_scsi])
         self.vm.qmp_log('device_add', id='scsi-hd0', driver='scsi-hd', drive='hd0')
 
 if __name__ == '__main__':
diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257
index 7cd25208296e..c72c82a171b4 100755
--- a/tests/qemu-iotests/257
+++ b/tests/qemu-iotests/257
@@ -292,7 +292,7 @@ def test_bitmap_sync(bsync_mode, msync_mode='bitmap', failure=None):
         log('--- Preparing image & VM ---\n')
         drive0 = Drive(img_path, vm=vm)
         drive0.img_create(iotests.imgfmt, SIZE)
-        vm.add_device("{},id=scsi0".format(iotests.get_virtio_scsi_device()))
+        vm.add_device("{},id=scsi0".format('virtio-scsi'))
         vm.launch()
 
         file_config = {
@@ -449,7 +449,7 @@ def test_backup_api():
         log('--- Preparing image & VM ---\n')
         drive0 = Drive(img_path, vm=vm)
         drive0.img_create(iotests.imgfmt, SIZE)
-        vm.add_device("{},id=scsi0".format(iotests.get_virtio_scsi_device()))
+        vm.add_device("{},id=scsi0".format('virtio-scsi'))
         vm.launch()
 
         file_config = {
diff --git a/tests/qemu-iotests/307 b/tests/qemu-iotests/307
index 9008974346b0..c7685347bc4c 100755
--- a/tests/qemu-iotests/307
+++ b/tests/qemu-iotests/307
@@ -40,13 +40,11 @@ with iotests.FilePath('image') as img, \
 
     iotests.log('=== Launch VM ===')
 
-    virtio_scsi_device = iotests.get_virtio_scsi_device()
-
     vm.add_object('iothread,id=iothread0')
     vm.add_blockdev(f'file,filename={img},node-name=file')
     vm.add_blockdev(f'{iotests.imgfmt},file=file,node-name=fmt')
     vm.add_blockdev('raw,file=file,node-name=ro,read-only=on')
-    vm.add_device(f'id=scsi0,driver={virtio_scsi_device},iothread=iothread0')
+    vm.add_device(f'id=scsi0,driver=virtio-scsi,iothread=iothread0')
     vm.launch()
 
     vm.qmp_log('nbd-server-start',
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 90d0b6252368..1e9e6a066e90 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -234,11 +234,6 @@ def qemu_io_silent_check(*args):
                                stderr=subprocess.STDOUT)
     return exitcode == 0
 
-def get_virtio_scsi_device():
-    if qemu_default_machine == 's390-ccw-virtio':
-        return 'virtio-scsi-ccw'
-    return 'virtio-scsi-pci'
-
 class QemuIoInteractive:
     def __init__(self, *args):
         self.args = qemu_io_args_no_fmt + list(args)
-- 
2.30.2



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

* [PATCH v2 5/6] iotests: test m68k with the virt machine
  2021-03-19 13:25 [PATCH v2 0/6] iotests: fix failures with non-PCI machines Laurent Vivier
                   ` (3 preceding siblings ...)
  2021-03-19 13:25 ` [PATCH v2 4/6] iotests: Revert "iotests: use -ccw on s390x for 040, 139, and 182" Laurent Vivier
@ 2021-03-19 13:25 ` Laurent Vivier
  2021-03-19 14:50   ` Cornelia Huck
  2021-03-19 13:25 ` [PATCH v2 6/6] iotests: iothreads need ioeventfd Laurent Vivier
  5 siblings, 1 reply; 21+ messages in thread
From: Laurent Vivier @ 2021-03-19 13:25 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Philippe Mathieu-Daudé,
	Cornelia Huck, Markus Armbruster, Max Reitz, qemu-s390x,
	Paolo Bonzini, Philippe Mathieu-Daudé,
	Laurent Vivier

This allows to cover the virtio tests with a 32bit big-endian
virtio-mmio machine.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 tests/qemu-iotests/testenv.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py
index 1fbec854c1f7..6d27712617a3 100644
--- a/tests/qemu-iotests/testenv.py
+++ b/tests/qemu-iotests/testenv.py
@@ -208,6 +208,7 @@ def __init__(self, imgfmt: str, imgproto: str, aiomode: str,
             ('arm', 'virt'),
             ('aarch64', 'virt'),
             ('avr', 'mega2560'),
+            ('m68k', 'virt'),
             ('rx', 'gdbsim-r5f562n8'),
             ('tricore', 'tricore_testboard')
         )
-- 
2.30.2



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

* [PATCH v2 6/6] iotests: iothreads need ioeventfd
  2021-03-19 13:25 [PATCH v2 0/6] iotests: fix failures with non-PCI machines Laurent Vivier
                   ` (4 preceding siblings ...)
  2021-03-19 13:25 ` [PATCH v2 5/6] iotests: test m68k with the virt machine Laurent Vivier
@ 2021-03-19 13:25 ` Laurent Vivier
  2021-03-19 13:36   ` Philippe Mathieu-Daudé
  5 siblings, 1 reply; 21+ messages in thread
From: Laurent Vivier @ 2021-03-19 13:25 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Cornelia Huck, Markus Armbruster,
	Max Reitz, qemu-s390x, Paolo Bonzini, Philippe Mathieu-Daudé,
	Laurent Vivier

And ioeventfd are only available with virtio-scsi-pci or virtio-scsi-ccw,
use the alias but add a rule to require virtio-scsi-pci or virtio-scsi-ccw
for the tests that use iothreads.

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

diff --git a/tests/qemu-iotests/127 b/tests/qemu-iotests/127
index 98e8e82a8210..abe24861100d 100755
--- a/tests/qemu-iotests/127
+++ b/tests/qemu-iotests/127
@@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow2
 _supported_proto file fuse
 
-_require_devices virtio-scsi scsi-hd
+_require_devices scsi-hd
+_require_devices virtio-scsi-pci || _require_devices virtio-scsi-ccw
 
 IMG_SIZE=64K
 
diff --git a/tests/qemu-iotests/256 b/tests/qemu-iotests/256
index 8d82a1dd865f..13666813bd8f 100755
--- a/tests/qemu-iotests/256
+++ b/tests/qemu-iotests/256
@@ -24,6 +24,8 @@ import os
 import iotests
 from iotests import log
 
+iotests._verify_virtio_scsi_pci_or_ccw()
+
 iotests.script_initialize(supported_fmts=['qcow2'])
 size = 64 * 1024 * 1024
 
@@ -61,8 +63,8 @@ with iotests.FilePath('img0') as img0_path, \
     log('--- Preparing images & VM ---\n')
     vm.add_object('iothread,id=iothread0')
     vm.add_object('iothread,id=iothread1')
-    vm.add_device('virtio-scsi-pci,id=scsi0,iothread=iothread0')
-    vm.add_device('virtio-scsi-pci,id=scsi1,iothread=iothread1')
+    vm.add_device('virtio-scsi,id=scsi0,iothread=iothread0')
+    vm.add_device('virtio-scsi,id=scsi1,iothread=iothread1')
     iotests.qemu_img_create('-f', iotests.imgfmt, img0_path, str(size))
     iotests.qemu_img_create('-f', iotests.imgfmt, img1_path, str(size))
     vm.add_drive(img0_path, interface='none')
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 1e9e6a066e90..d3faf96005dd 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -1146,6 +1146,11 @@ def _verify_virtio_blk() -> None:
     if 'virtio-blk' not in out:
         notrun('Missing virtio-blk in QEMU binary')
 
+def _verify_virtio_scsi_pci_or_ccw() -> None:
+    out = qemu_pipe('-M', 'none', '-device', 'help')
+    if 'virtio-scsi-pci' not in out and 'virtio-scsi-ccw' not in out:
+        notrun('Missing virtio-scsi-pci and virtio-scsi-ccw in QEMU binary')
+
 
 def supports_quorum():
     return 'quorum' in qemu_img_pipe('--help')
-- 
2.30.2



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

* Re: [PATCH v2 2/6] m68k: add the virtio devices aliases
  2021-03-19 13:25 ` [PATCH v2 2/6] m68k: add the virtio devices aliases Laurent Vivier
@ 2021-03-19 13:33   ` Philippe Mathieu-Daudé
  2021-03-19 14:41   ` Cornelia Huck
  1 sibling, 0 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-03-19 13:33 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Cornelia Huck, Markus Armbruster,
	Max Reitz, qemu-s390x, Paolo Bonzini

On 3/19/21 2:25 PM, Laurent Vivier wrote:
> Similarly to 5f629d943cb0 ("s390x: fix s390 virtio aliases"),
> define the virtio aliases.
> 
> This allows to start machines with virtio devices without
> knowledge of the implementation type.
> 
> For instance, we can use "-device virtio-scsi" on
> m68k, s390x or PC, and the device will be respectively
> "virtio-scsi-device", "virtio-scsi-ccw" or "virtio-scsi-pci".
> 
> This already exists for s390x and -ccw interfaces, add them
> for m68k and MMIO (-device) interfaces.
> 
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>  include/sysemu/arch_init.h |  1 +
>  softmmu/qdev-monitor.c     | 12 ++++++++++++
>  2 files changed, 13 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


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

* Re: [PATCH v2 6/6] iotests: iothreads need ioeventfd
  2021-03-19 13:25 ` [PATCH v2 6/6] iotests: iothreads need ioeventfd Laurent Vivier
@ 2021-03-19 13:36   ` Philippe Mathieu-Daudé
  2021-03-19 13:51     ` Laurent Vivier
  0 siblings, 1 reply; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-03-19 13:36 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Cornelia Huck, Markus Armbruster,
	Max Reitz, qemu-s390x, Paolo Bonzini

On 3/19/21 2:25 PM, Laurent Vivier wrote:
> And ioeventfd are only available with virtio-scsi-pci or virtio-scsi-ccw,
> use the alias but add a rule to require virtio-scsi-pci or virtio-scsi-ccw
> for the tests that use iothreads.
> 
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>  tests/qemu-iotests/127        | 3 ++-
>  tests/qemu-iotests/256        | 6 ++++--
>  tests/qemu-iotests/iotests.py | 5 +++++
>  3 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/qemu-iotests/127 b/tests/qemu-iotests/127
> index 98e8e82a8210..abe24861100d 100755
> --- a/tests/qemu-iotests/127
> +++ b/tests/qemu-iotests/127
> @@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
>  _supported_fmt qcow2
>  _supported_proto file fuse
>  
> -_require_devices virtio-scsi scsi-hd
> +_require_devices scsi-hd
> +_require_devices virtio-scsi-pci || _require_devices virtio-scsi-ccw
>  
>  IMG_SIZE=64K
>  
> diff --git a/tests/qemu-iotests/256 b/tests/qemu-iotests/256
> index 8d82a1dd865f..13666813bd8f 100755
> --- a/tests/qemu-iotests/256
> +++ b/tests/qemu-iotests/256
> @@ -24,6 +24,8 @@ import os
>  import iotests
>  from iotests import log
>  
> +iotests._verify_virtio_scsi_pci_or_ccw()
> +
>  iotests.script_initialize(supported_fmts=['qcow2'])
>  size = 64 * 1024 * 1024
>  
> @@ -61,8 +63,8 @@ with iotests.FilePath('img0') as img0_path, \
>      log('--- Preparing images & VM ---\n')
>      vm.add_object('iothread,id=iothread0')
>      vm.add_object('iothread,id=iothread1')
> -    vm.add_device('virtio-scsi-pci,id=scsi0,iothread=iothread0')
> -    vm.add_device('virtio-scsi-pci,id=scsi1,iothread=iothread1')
> +    vm.add_device('virtio-scsi,id=scsi0,iothread=iothread0')
> +    vm.add_device('virtio-scsi,id=scsi1,iothread=iothread1')
>      iotests.qemu_img_create('-f', iotests.imgfmt, img0_path, str(size))
>      iotests.qemu_img_create('-f', iotests.imgfmt, img1_path, str(size))
>      vm.add_drive(img0_path, interface='none')
> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
> index 1e9e6a066e90..d3faf96005dd 100644
> --- a/tests/qemu-iotests/iotests.py
> +++ b/tests/qemu-iotests/iotests.py
> @@ -1146,6 +1146,11 @@ def _verify_virtio_blk() -> None:
>      if 'virtio-blk' not in out:
>          notrun('Missing virtio-blk in QEMU binary')
>  
> +def _verify_virtio_scsi_pci_or_ccw() -> None:
> +    out = qemu_pipe('-M', 'none', '-device', 'help')
> +    if 'virtio-scsi-pci' not in out and 'virtio-scsi-ccw' not in out:

^ "and" is OK

> +        notrun('Missing virtio-scsi-pci and virtio-scsi-ccw in QEMU binary')

^ here "and" -> "or"?

> +
>  
>  def supports_quorum():
>      return 'quorum' in qemu_img_pipe('--help')
> 



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

* Re: [PATCH v2 3/6] blockdev: with -drive if=virtio, use generic virtio-blk
  2021-03-19 13:25 ` [PATCH v2 3/6] blockdev: with -drive if=virtio, use generic virtio-blk Laurent Vivier
@ 2021-03-19 13:36   ` Philippe Mathieu-Daudé
  2021-03-19 14:46   ` Cornelia Huck
  1 sibling, 0 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-03-19 13:36 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Cornelia Huck, Markus Armbruster,
	Max Reitz, qemu-s390x, Paolo Bonzini

On 3/19/21 2:25 PM, Laurent Vivier wrote:
> Rather than checking if the machine is an s390x to use virtio-blk-ccw
> instead of virtio-blk-pci, use the alias virtio-blk that is set to
> the expected target.
> 
> This also enables the use of virtio-blk-device for targets without
> PCI or CCW.
> 
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>  blockdev.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>



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

* Re: [PATCH v2 4/6] iotests: Revert "iotests: use -ccw on s390x for 040, 139, and 182"
  2021-03-19 13:25 ` [PATCH v2 4/6] iotests: Revert "iotests: use -ccw on s390x for 040, 139, and 182" Laurent Vivier
@ 2021-03-19 13:42   ` Philippe Mathieu-Daudé
  2021-03-19 14:49   ` Cornelia Huck
  1 sibling, 0 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-03-19 13:42 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Cornelia Huck, Markus Armbruster,
	Max Reitz, qemu-s390x, Paolo Bonzini

On 3/19/21 2:25 PM, Laurent Vivier wrote:
> Commit f1d5516ab583 introduces a test in some iotests to check if
> the machine is a s390-ccw-virtio and to select virtio-*-ccw rather
> than virtio-*-pci.
> 
> We don't need that because QEMU already provides aliases to use the correct
> virtio interface according to the machine type.

And get_virtio_scsi_device() is removed because we use the alias
instead.

> 
> This patch removes all virtio-*-pci and virtio-*-ccw to use virtio-*
> instead. This also enables virtio-mmio devices (virtio-*-device)
> 
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> cc: Cornelia Huck <cohuck@redhat.com>
> ---
>  tests/qemu-iotests/040        |  2 +-
>  tests/qemu-iotests/051        | 12 +-----------
>  tests/qemu-iotests/051.out    |  2 +-
>  tests/qemu-iotests/051.pc.out |  2 +-
>  tests/qemu-iotests/068        |  4 +---
>  tests/qemu-iotests/093        |  3 +--
>  tests/qemu-iotests/139        |  9 ++-------
>  tests/qemu-iotests/182        | 13 ++-----------
>  tests/qemu-iotests/238        |  4 +---
>  tests/qemu-iotests/240        | 10 +++++-----
>  tests/qemu-iotests/257        |  4 ++--
>  tests/qemu-iotests/307        |  4 +---
>  tests/qemu-iotests/iotests.py |  5 -----
>  13 files changed, 19 insertions(+), 55 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>



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

* Re: [PATCH v2 6/6] iotests: iothreads need ioeventfd
  2021-03-19 13:36   ` Philippe Mathieu-Daudé
@ 2021-03-19 13:51     ` Laurent Vivier
  2021-03-19 14:23       ` Cornelia Huck
  0 siblings, 1 reply; 21+ messages in thread
From: Laurent Vivier @ 2021-03-19 13:51 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Cornelia Huck, Markus Armbruster,
	Max Reitz, qemu-s390x, Paolo Bonzini

Le 19/03/2021 à 14:36, Philippe Mathieu-Daudé a écrit :
> On 3/19/21 2:25 PM, Laurent Vivier wrote:
>> And ioeventfd are only available with virtio-scsi-pci or virtio-scsi-ccw,
>> use the alias but add a rule to require virtio-scsi-pci or virtio-scsi-ccw
>> for the tests that use iothreads.
>>
>> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
>> ---
>>  tests/qemu-iotests/127        | 3 ++-
>>  tests/qemu-iotests/256        | 6 ++++--
>>  tests/qemu-iotests/iotests.py | 5 +++++
>>  3 files changed, 11 insertions(+), 3 deletions(-)
>>
>> diff --git a/tests/qemu-iotests/127 b/tests/qemu-iotests/127
>> index 98e8e82a8210..abe24861100d 100755
>> --- a/tests/qemu-iotests/127
>> +++ b/tests/qemu-iotests/127
>> @@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
>>  _supported_fmt qcow2
>>  _supported_proto file fuse
>>  
>> -_require_devices virtio-scsi scsi-hd
>> +_require_devices scsi-hd
>> +_require_devices virtio-scsi-pci || _require_devices virtio-scsi-ccw

Re-reading the code, I think this cannot work because we have an "exit" if the test fails.

The test is executed anyway because s390x provides virtio-scsi-ccw and virtio-scsi-pci.

Thanks,
Laurent


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

* Re: [PATCH v2 6/6] iotests: iothreads need ioeventfd
  2021-03-19 13:51     ` Laurent Vivier
@ 2021-03-19 14:23       ` Cornelia Huck
  2021-03-19 14:27         ` Laurent Vivier
  0 siblings, 1 reply; 21+ messages in thread
From: Cornelia Huck @ 2021-03-19 14:23 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Markus Armbruster, qemu-devel,
	Max Reitz, qemu-s390x, Paolo Bonzini, Philippe Mathieu-Daudé

On Fri, 19 Mar 2021 14:51:59 +0100
Laurent Vivier <laurent@vivier.eu> wrote:

> Le 19/03/2021 à 14:36, Philippe Mathieu-Daudé a écrit :
> > On 3/19/21 2:25 PM, Laurent Vivier wrote:  
> >> And ioeventfd are only available with virtio-scsi-pci or virtio-scsi-ccw,
> >> use the alias but add a rule to require virtio-scsi-pci or virtio-scsi-ccw
> >> for the tests that use iothreads.
> >>
> >> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> >> ---
> >>  tests/qemu-iotests/127        | 3 ++-
> >>  tests/qemu-iotests/256        | 6 ++++--
> >>  tests/qemu-iotests/iotests.py | 5 +++++
> >>  3 files changed, 11 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/tests/qemu-iotests/127 b/tests/qemu-iotests/127
> >> index 98e8e82a8210..abe24861100d 100755
> >> --- a/tests/qemu-iotests/127
> >> +++ b/tests/qemu-iotests/127
> >> @@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
> >>  _supported_fmt qcow2
> >>  _supported_proto file fuse
> >>  
> >> -_require_devices virtio-scsi scsi-hd
> >> +_require_devices scsi-hd
> >> +_require_devices virtio-scsi-pci || _require_devices virtio-scsi-ccw  
> 
> Re-reading the code, I think this cannot work because we have an "exit" if the test fails.

We could try to make _require_devices accept alternatives, but that is
probably overkill...

> 
> The test is executed anyway because s390x provides virtio-scsi-ccw and virtio-scsi-pci.

...because of this.

Maybe just add a comment that we require pci or ccw because iothreads
depend on ioventfd, but checking for pci is enough, as we have pci when
we have ccw?

> 
> Thanks,
> Laurent
> 



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

* Re: [PATCH v2 6/6] iotests: iothreads need ioeventfd
  2021-03-19 14:23       ` Cornelia Huck
@ 2021-03-19 14:27         ` Laurent Vivier
  2021-03-19 14:32           ` Cornelia Huck
  0 siblings, 1 reply; 21+ messages in thread
From: Laurent Vivier @ 2021-03-19 14:27 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Markus Armbruster, qemu-devel,
	Max Reitz, qemu-s390x, Paolo Bonzini, Philippe Mathieu-Daudé

Le 19/03/2021 à 15:23, Cornelia Huck a écrit :
> On Fri, 19 Mar 2021 14:51:59 +0100
> Laurent Vivier <laurent@vivier.eu> wrote:
> 
>> Le 19/03/2021 à 14:36, Philippe Mathieu-Daudé a écrit :
>>> On 3/19/21 2:25 PM, Laurent Vivier wrote:  
>>>> And ioeventfd are only available with virtio-scsi-pci or virtio-scsi-ccw,
>>>> use the alias but add a rule to require virtio-scsi-pci or virtio-scsi-ccw
>>>> for the tests that use iothreads.
>>>>
>>>> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
>>>> ---
>>>>  tests/qemu-iotests/127        | 3 ++-
>>>>  tests/qemu-iotests/256        | 6 ++++--
>>>>  tests/qemu-iotests/iotests.py | 5 +++++
>>>>  3 files changed, 11 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/tests/qemu-iotests/127 b/tests/qemu-iotests/127
>>>> index 98e8e82a8210..abe24861100d 100755
>>>> --- a/tests/qemu-iotests/127
>>>> +++ b/tests/qemu-iotests/127
>>>> @@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
>>>>  _supported_fmt qcow2
>>>>  _supported_proto file fuse
>>>>  
>>>> -_require_devices virtio-scsi scsi-hd
>>>> +_require_devices scsi-hd
>>>> +_require_devices virtio-scsi-pci || _require_devices virtio-scsi-ccw  
>>
>> Re-reading the code, I think this cannot work because we have an "exit" if the test fails.
> 
> We could try to make _require_devices accept alternatives, but that is
> probably overkill...
> 
>>
>> The test is executed anyway because s390x provides virtio-scsi-ccw and virtio-scsi-pci.
> 
> ...because of this.
> 
> Maybe just add a comment that we require pci or ccw because iothreads
> depend on ioventfd, but checking for pci is enough, as we have pci when
> we have ccw?
> 

Well... bash is fun:

_require_one_device_of()
{
    available=$($QEMU -M none -device help | \
                grep ^name | sed -e 's/^name "//' -e 's/".*$//')
    for device
    do
        if echo "$available" | grep -q "$device" ; then
            return
        fi
    done
    _notrun "$* not available"
}

and:

_require_one_device_of virtio-scsi-pci virtio-scsi-ccw

Thanks,
Laurent


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

* Re: [PATCH v2 6/6] iotests: iothreads need ioeventfd
  2021-03-19 14:27         ` Laurent Vivier
@ 2021-03-19 14:32           ` Cornelia Huck
  0 siblings, 0 replies; 21+ messages in thread
From: Cornelia Huck @ 2021-03-19 14:32 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Markus Armbruster, qemu-devel,
	Max Reitz, qemu-s390x, Paolo Bonzini, Philippe Mathieu-Daudé

On Fri, 19 Mar 2021 15:27:24 +0100
Laurent Vivier <laurent@vivier.eu> wrote:

> Le 19/03/2021 à 15:23, Cornelia Huck a écrit :
> > On Fri, 19 Mar 2021 14:51:59 +0100
> > Laurent Vivier <laurent@vivier.eu> wrote:
> >   
> >> Le 19/03/2021 à 14:36, Philippe Mathieu-Daudé a écrit :  
> >>> On 3/19/21 2:25 PM, Laurent Vivier wrote:    
> >>>> And ioeventfd are only available with virtio-scsi-pci or virtio-scsi-ccw,
> >>>> use the alias but add a rule to require virtio-scsi-pci or virtio-scsi-ccw
> >>>> for the tests that use iothreads.
> >>>>
> >>>> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> >>>> ---
> >>>>  tests/qemu-iotests/127        | 3 ++-
> >>>>  tests/qemu-iotests/256        | 6 ++++--
> >>>>  tests/qemu-iotests/iotests.py | 5 +++++
> >>>>  3 files changed, 11 insertions(+), 3 deletions(-)
> >>>>
> >>>> diff --git a/tests/qemu-iotests/127 b/tests/qemu-iotests/127
> >>>> index 98e8e82a8210..abe24861100d 100755
> >>>> --- a/tests/qemu-iotests/127
> >>>> +++ b/tests/qemu-iotests/127
> >>>> @@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
> >>>>  _supported_fmt qcow2
> >>>>  _supported_proto file fuse
> >>>>  
> >>>> -_require_devices virtio-scsi scsi-hd
> >>>> +_require_devices scsi-hd
> >>>> +_require_devices virtio-scsi-pci || _require_devices virtio-scsi-ccw    
> >>
> >> Re-reading the code, I think this cannot work because we have an "exit" if the test fails.  
> > 
> > We could try to make _require_devices accept alternatives, but that is
> > probably overkill...
> >   
> >>
> >> The test is executed anyway because s390x provides virtio-scsi-ccw and virtio-scsi-pci.  
> > 
> > ...because of this.
> > 
> > Maybe just add a comment that we require pci or ccw because iothreads
> > depend on ioventfd, but checking for pci is enough, as we have pci when
> > we have ccw?
> >   
> 
> Well... bash is fun:
> 
> _require_one_device_of()
> {
>     available=$($QEMU -M none -device help | \
>                 grep ^name | sed -e 's/^name "//' -e 's/".*$//')
>     for device
>     do
>         if echo "$available" | grep -q "$device" ; then
>             return
>         fi
>     done
>     _notrun "$* not available"
> }
> 
> and:
> 
> _require_one_device_of virtio-scsi-pci virtio-scsi-ccw
> 
> Thanks,
> Laurent
> 

Even better :)



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

* Re: [PATCH v2 1/6] qdev: define list of archs with virtio-pci or virtio-ccw
  2021-03-19 13:25 ` [PATCH v2 1/6] qdev: define list of archs with virtio-pci or virtio-ccw Laurent Vivier
@ 2021-03-19 14:40   ` Cornelia Huck
  0 siblings, 0 replies; 21+ messages in thread
From: Cornelia Huck @ 2021-03-19 14:40 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Markus Armbruster, qemu-devel,
	Max Reitz, qemu-s390x, Paolo Bonzini, Philippe Mathieu-Daudé

On Fri, 19 Mar 2021 14:25:32 +0100
Laurent Vivier <laurent@vivier.eu> wrote:

> This is used to define virtio-*-pci and virtio-*-ccw aliases
> rather than substracting the CCW architecture from all the others.
> 
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>  include/sysemu/arch_init.h |  7 +++++
>  softmmu/qdev-monitor.c     | 53 ++++++++++++++++++--------------------
>  2 files changed, 32 insertions(+), 28 deletions(-)
> 
> diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h
> index 54f069d49126..7217a822a14b 100644
> --- a/include/sysemu/arch_init.h
> +++ b/include/sysemu/arch_init.h
> @@ -35,4 +35,11 @@ extern const uint32_t arch_type;
>  int kvm_available(void);
>  int xen_available(void);
>  

Maybe add a comment

/* default virtio transport per architecture */

> +#define QEMU_ARCH_VIRTIO_PCI (QEMU_ARCH_ALPHA | QEMU_ARCH_ARM | \
> +                              QEMU_ARCH_HPPA | QEMU_ARCH_I386 | \
> +                              QEMU_ARCH_MIPS | QEMU_ARCH_PPC |  \
> +                              QEMU_ARCH_RISCV | QEMU_ARCH_SH4 | \
> +                              QEMU_ARCH_SPARC | QEMU_ARCH_XTENSA)
> +#define QEMU_ARCH_VIRTIO_CCW (QEMU_ARCH_S390X)
> +
>  #endif

Reviewed-by: Cornelia Huck <cohuck@redhat.com>



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

* Re: [PATCH v2 2/6] m68k: add the virtio devices aliases
  2021-03-19 13:25 ` [PATCH v2 2/6] m68k: add the virtio devices aliases Laurent Vivier
  2021-03-19 13:33   ` Philippe Mathieu-Daudé
@ 2021-03-19 14:41   ` Cornelia Huck
  1 sibling, 0 replies; 21+ messages in thread
From: Cornelia Huck @ 2021-03-19 14:41 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Markus Armbruster, qemu-devel,
	Max Reitz, qemu-s390x, Paolo Bonzini, Philippe Mathieu-Daudé

On Fri, 19 Mar 2021 14:25:33 +0100
Laurent Vivier <laurent@vivier.eu> wrote:

> Similarly to 5f629d943cb0 ("s390x: fix s390 virtio aliases"),
> define the virtio aliases.
> 
> This allows to start machines with virtio devices without
> knowledge of the implementation type.
> 
> For instance, we can use "-device virtio-scsi" on
> m68k, s390x or PC, and the device will be respectively
> "virtio-scsi-device", "virtio-scsi-ccw" or "virtio-scsi-pci".
> 
> This already exists for s390x and -ccw interfaces, add them
> for m68k and MMIO (-device) interfaces.
> 
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>  include/sysemu/arch_init.h |  1 +
>  softmmu/qdev-monitor.c     | 12 ++++++++++++
>  2 files changed, 13 insertions(+)

Reviewed-by: Cornelia Huck <cohuck@redhat.com>



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

* Re: [PATCH v2 3/6] blockdev: with -drive if=virtio, use generic virtio-blk
  2021-03-19 13:25 ` [PATCH v2 3/6] blockdev: with -drive if=virtio, use generic virtio-blk Laurent Vivier
  2021-03-19 13:36   ` Philippe Mathieu-Daudé
@ 2021-03-19 14:46   ` Cornelia Huck
  2021-03-19 18:15     ` Laurent Vivier
  1 sibling, 1 reply; 21+ messages in thread
From: Cornelia Huck @ 2021-03-19 14:46 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Markus Armbruster, qemu-devel,
	Max Reitz, qemu-s390x, Paolo Bonzini, Philippe Mathieu-Daudé

On Fri, 19 Mar 2021 14:25:34 +0100
Laurent Vivier <laurent@vivier.eu> wrote:

> Rather than checking if the machine is an s390x to use virtio-blk-ccw
> instead of virtio-blk-pci, use the alias virtio-blk that is set to
> the expected target.

One side effect: if we add a new architecture and don't define the
aliases for it, this function probably won't do the right thing; prior
to the patch, it would simply default to virtio-blk-pci. Probably not a
big deal, but we need to be careful to keep the alias defines up to
date, which previously wasn't such a big deal.

> 
> This also enables the use of virtio-blk-device for targets without
> PCI or CCW.
> 
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>  blockdev.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/blockdev.c b/blockdev.c
> index 5cc7c7effe9f..64da5350e3ad 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -969,11 +969,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
>          QemuOpts *devopts;
>          devopts = qemu_opts_create(qemu_find_opts("device"), NULL, 0,
>                                     &error_abort);
> -        if (arch_type == QEMU_ARCH_S390X) {
> -            qemu_opt_set(devopts, "driver", "virtio-blk-ccw", &error_abort);
> -        } else {
> -            qemu_opt_set(devopts, "driver", "virtio-blk-pci", &error_abort);
> -        }
> +        qemu_opt_set(devopts, "driver", "virtio-blk", &error_abort);
>          qemu_opt_set(devopts, "drive", qdict_get_str(bs_opts, "id"),
>                       &error_abort);
>      }



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

* Re: [PATCH v2 4/6] iotests: Revert "iotests: use -ccw on s390x for 040, 139, and 182"
  2021-03-19 13:25 ` [PATCH v2 4/6] iotests: Revert "iotests: use -ccw on s390x for 040, 139, and 182" Laurent Vivier
  2021-03-19 13:42   ` Philippe Mathieu-Daudé
@ 2021-03-19 14:49   ` Cornelia Huck
  1 sibling, 0 replies; 21+ messages in thread
From: Cornelia Huck @ 2021-03-19 14:49 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Markus Armbruster, qemu-devel,
	Max Reitz, qemu-s390x, Paolo Bonzini, Philippe Mathieu-Daudé

On Fri, 19 Mar 2021 14:25:35 +0100
Laurent Vivier <laurent@vivier.eu> wrote:

> Commit f1d5516ab583 introduces a test in some iotests to check if
> the machine is a s390-ccw-virtio and to select virtio-*-ccw rather
> than virtio-*-pci.
> 
> We don't need that because QEMU already provides aliases to use the correct
> virtio interface according to the machine type.
> 
> This patch removes all virtio-*-pci and virtio-*-ccw to use virtio-*
> instead. This also enables virtio-mmio devices (virtio-*-device)
> 
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> cc: Cornelia Huck <cohuck@redhat.com>
> ---
>  tests/qemu-iotests/040        |  2 +-
>  tests/qemu-iotests/051        | 12 +-----------
>  tests/qemu-iotests/051.out    |  2 +-
>  tests/qemu-iotests/051.pc.out |  2 +-
>  tests/qemu-iotests/068        |  4 +---
>  tests/qemu-iotests/093        |  3 +--
>  tests/qemu-iotests/139        |  9 ++-------
>  tests/qemu-iotests/182        | 13 ++-----------
>  tests/qemu-iotests/238        |  4 +---
>  tests/qemu-iotests/240        | 10 +++++-----
>  tests/qemu-iotests/257        |  4 ++--
>  tests/qemu-iotests/307        |  4 +---
>  tests/qemu-iotests/iotests.py |  5 -----
>  13 files changed, 19 insertions(+), 55 deletions(-)

Reviewed-by: Cornelia Huck <cohuck@redhat.com>



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

* Re: [PATCH v2 5/6] iotests: test m68k with the virt machine
  2021-03-19 13:25 ` [PATCH v2 5/6] iotests: test m68k with the virt machine Laurent Vivier
@ 2021-03-19 14:50   ` Cornelia Huck
  0 siblings, 0 replies; 21+ messages in thread
From: Cornelia Huck @ 2021-03-19 14:50 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Markus Armbruster, qemu-devel,
	Max Reitz, qemu-s390x, Paolo Bonzini, Philippe Mathieu-Daudé,
	Philippe Mathieu-Daudé

On Fri, 19 Mar 2021 14:25:36 +0100
Laurent Vivier <laurent@vivier.eu> wrote:

> This allows to cover the virtio tests with a 32bit big-endian
> virtio-mmio machine.
> 
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>  tests/qemu-iotests/testenv.py | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py
> index 1fbec854c1f7..6d27712617a3 100644
> --- a/tests/qemu-iotests/testenv.py
> +++ b/tests/qemu-iotests/testenv.py
> @@ -208,6 +208,7 @@ def __init__(self, imgfmt: str, imgproto: str, aiomode: str,
>              ('arm', 'virt'),
>              ('aarch64', 'virt'),
>              ('avr', 'mega2560'),
> +            ('m68k', 'virt'),
>              ('rx', 'gdbsim-r5f562n8'),
>              ('tricore', 'tricore_testboard')
>          )

Reviewed-by: Cornelia Huck <cohuck@redhat.com>



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

* Re: [PATCH v2 3/6] blockdev: with -drive if=virtio, use generic virtio-blk
  2021-03-19 14:46   ` Cornelia Huck
@ 2021-03-19 18:15     ` Laurent Vivier
  0 siblings, 0 replies; 21+ messages in thread
From: Laurent Vivier @ 2021-03-19 18:15 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	Eduardo Habkost, qemu-block, Markus Armbruster, qemu-devel,
	Max Reitz, qemu-s390x, Paolo Bonzini, Philippe Mathieu-Daudé

Le 19/03/2021 à 15:46, Cornelia Huck a écrit :
> On Fri, 19 Mar 2021 14:25:34 +0100
> Laurent Vivier <laurent@vivier.eu> wrote:
> 
>> Rather than checking if the machine is an s390x to use virtio-blk-ccw
>> instead of virtio-blk-pci, use the alias virtio-blk that is set to
>> the expected target.
> 
> One side effect: if we add a new architecture and don't define the
> aliases for it, this function probably won't do the right thing; prior
> to the patch, it would simply default to virtio-blk-pci. Probably not a
> big deal, but we need to be careful to keep the alias defines up to
> date, which previously wasn't such a big deal.

But it will be easy to detect because we will have the error "unknown device: virtio-blk".
It will be a good reminder to add the aliases...

Thanks,
Laurent

> 
>>
>> This also enables the use of virtio-blk-device for targets without
>> PCI or CCW.
>>
>> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
>> ---
>>  blockdev.c | 6 +-----
>>  1 file changed, 1 insertion(+), 5 deletions(-)
>>
>> diff --git a/blockdev.c b/blockdev.c
>> index 5cc7c7effe9f..64da5350e3ad 100644
>> --- a/blockdev.c
>> +++ b/blockdev.c
>> @@ -969,11 +969,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
>>          QemuOpts *devopts;
>>          devopts = qemu_opts_create(qemu_find_opts("device"), NULL, 0,
>>                                     &error_abort);
>> -        if (arch_type == QEMU_ARCH_S390X) {
>> -            qemu_opt_set(devopts, "driver", "virtio-blk-ccw", &error_abort);
>> -        } else {
>> -            qemu_opt_set(devopts, "driver", "virtio-blk-pci", &error_abort);
>> -        }
>> +        qemu_opt_set(devopts, "driver", "virtio-blk", &error_abort);
>>          qemu_opt_set(devopts, "drive", qdict_get_str(bs_opts, "id"),
>>                       &error_abort);
>>      }
> 



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

end of thread, other threads:[~2021-03-19 18:18 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-19 13:25 [PATCH v2 0/6] iotests: fix failures with non-PCI machines Laurent Vivier
2021-03-19 13:25 ` [PATCH v2 1/6] qdev: define list of archs with virtio-pci or virtio-ccw Laurent Vivier
2021-03-19 14:40   ` Cornelia Huck
2021-03-19 13:25 ` [PATCH v2 2/6] m68k: add the virtio devices aliases Laurent Vivier
2021-03-19 13:33   ` Philippe Mathieu-Daudé
2021-03-19 14:41   ` Cornelia Huck
2021-03-19 13:25 ` [PATCH v2 3/6] blockdev: with -drive if=virtio, use generic virtio-blk Laurent Vivier
2021-03-19 13:36   ` Philippe Mathieu-Daudé
2021-03-19 14:46   ` Cornelia Huck
2021-03-19 18:15     ` Laurent Vivier
2021-03-19 13:25 ` [PATCH v2 4/6] iotests: Revert "iotests: use -ccw on s390x for 040, 139, and 182" Laurent Vivier
2021-03-19 13:42   ` Philippe Mathieu-Daudé
2021-03-19 14:49   ` Cornelia Huck
2021-03-19 13:25 ` [PATCH v2 5/6] iotests: test m68k with the virt machine Laurent Vivier
2021-03-19 14:50   ` Cornelia Huck
2021-03-19 13:25 ` [PATCH v2 6/6] iotests: iothreads need ioeventfd Laurent Vivier
2021-03-19 13:36   ` Philippe Mathieu-Daudé
2021-03-19 13:51     ` Laurent Vivier
2021-03-19 14:23       ` Cornelia Huck
2021-03-19 14:27         ` Laurent Vivier
2021-03-19 14:32           ` Cornelia Huck

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.