Patchwork [RFC/PATCH,2/2] s390: enable ipl device for virtio-ccw

login
register
mail settings
Submitter Christian Borntraeger
Date Dec. 7, 2012, 3:14 p.m.
Message ID <1354893290-53019-3-git-send-email-borntraeger@de.ibm.com>
Download mbox | patch
Permalink /patch/204522/
State New
Headers show

Comments

Christian Borntraeger - Dec. 7, 2012, 3:14 p.m.
In case of virtio-ccw we also want to get a disk by its
device id.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 hw/s390x/ipl-disk.c |    5 +++++
 1 file changed, 5 insertions(+)

Patch

diff --git a/hw/s390x/ipl-disk.c b/hw/s390x/ipl-disk.c
index 1aab32b..6a83d9c 100644
--- a/hw/s390x/ipl-disk.c
+++ b/hw/s390x/ipl-disk.c
@@ -21,6 +21,7 @@ 
 #include <sysemu.h>
 #include "hw/loader.h"
 #include "hw/s390-virtio-bus.h"
+#include "hw/s390x/virtio-ccw.h"
 #include "hw/sysbus.h"
 #include "hw/s390x/ipl.h"
 #include "hw/s390x/ipl-disk.h"
@@ -435,6 +436,10 @@  static VirtIOBlkConf *getVirtIOBlkConf(DeviceState *dev, const char *id)
         VirtIOS390Device *s390dev;
         s390dev = DO_UPCAST(VirtIOS390Device, qdev, dev);
         blk = &s390dev->blk;
+    } else if (strcmp(dev->parent_bus->name, "virtio-ccw") == 0) {
+        VirtioCcwData *ccwdev;
+        ccwdev = DO_UPCAST(VirtioCcwData, qdev, dev);
+        blk = &ccwdev->blk;
     } else {
         error_report("s390-ipl: device '%s' is not a virtio device",
                      id ? id : "0");