Skip to contentSkip to conversation

s390x: fix -drive in the absence of aliases

PATCH In review Anthony Liguori 2 participants 2 messages Feb 3, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390x: fix -drive in the absence of aliases

---
 blockdev.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
blockdev.c +5 -1
index 7e4c548..7d7ac31 100644
@@ -565,7 +565,11 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
     case IF_VIRTIO:
         /* add virtio block device */
         opts = qemu_opts_create(qemu_find_opts("device"), NULL, 0);
-        qemu_opt_set(opts, "driver", "virtio-blk");
+        if (arch_type == QEMU_ARCH_S390X) {
+            qemu_opt_set(opts, "driver", "virtio-blk-s390");
+        } else {
+            qemu_opt_set(opts, "driver", "virtio-blk-pci");
+        }
         qemu_opt_set(opts, "drive", dinfo->id);
         if (devaddr)
             qemu_opt_set(opts, "addr", devaddr);
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 4 lines · Anthony Liguori
---
  blockdev.c |    6 +++++-
  1 files changed, 5 insertions(+), 1 deletions(-)

*sigh*

my work directory was dirty. This needs a #include "arch_init.h" too.

Regards,

Anthony Liguori

Quoted 18 lines
blockdev.c +5 -1
index 7e4c548..7d7ac31 100644
@@ -565,7 +565,11 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
      case IF_VIRTIO:
          /* add virtio block device */
          opts = qemu_opts_create(qemu_find_opts("device"), NULL, 0);
-        qemu_opt_set(opts, "driver", "virtio-blk");
+        if (arch_type == QEMU_ARCH_S390X) {
+            qemu_opt_set(opts, "driver", "virtio-blk-s390");
+        } else {
+            qemu_opt_set(opts, "driver", "virtio-blk-pci");
+        }
          qemu_opt_set(opts, "drive", dinfo->id);
          if (devaddr)
              qemu_opt_set(opts, "addr", devaddr);