[PULL,18/22] blockdev: with -drive if=virtio, use generic virtio-blk

Message ID 20210324143021.8560-19-alex.bennee@linaro.org
State Accepted
Commit 9db1d3a2be9bfeb5ef3459a636e7545bf8f9b81b
Headers show
Series
  • various fixes (kernel-doc, semihosting, testing)
Related show

Commit Message

Alex Bennée March 24, 2021, 2:30 p.m.
From: Laurent Vivier <laurent@vivier.eu>


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>

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

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

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

Acked-by: Markus Armbruster <armbru@redhat.com>

Message-Id: <20210319202335.2397060-4-laurent@vivier.eu>
Message-Id: <20210323165308.15244-19-alex.bennee@linaro.org>

-- 
2.20.1

Patch

diff --git a/blockdev.c b/blockdev.c
index 621cc3b7c4..a57590aae4 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -962,11 +962,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);
     }