diff mbox

[RFC,V8,10/15] virtio-blk-s390 : Switch to the new API.

Message ID 1355910821-21302-11-git-send-email-fred.konrad@greensocs.com
State New
Headers show

Commit Message

fred.konrad@greensocs.com Dec. 19, 2012, 9:53 a.m. UTC
From: KONRAD Frederic <fred.konrad@greensocs.com>

Here the virtio-blk-s390 is modified for the new API. The device virtio-blk-s390
extends virtio-s390-device. It creates and connects a virtio-blk during the
init.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
---
 hw/s390-virtio-bus.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c
index 849adab..eba4f3f 100644
--- a/hw/s390-virtio-bus.c
+++ b/hw/s390-virtio-bus.c
@@ -165,14 +165,13 @@  static int s390_virtio_net_init(VirtIOS390Device *dev)
 
 static int s390_virtio_blk_init(VirtIOS390Device *dev)
 {
-    VirtIODevice *vdev;
-
-    vdev = virtio_blk_init((DeviceState *)dev, &dev->blk);
-    if (!vdev) {
+    DeviceState *vdev;
+    vdev = qdev_create(BUS(dev->bus), "virtio-blk");
+    virtio_blk_set_conf(vdev, &(dev->blk));
+    if (qdev_init(vdev) < 0) {
         return -1;
     }
-
-    return s390_virtio_device_init(dev, vdev);
+    return s390_virtio_device_init(dev, VIRTIO_DEVICE(vdev));
 }
 
 static int s390_virtio_serial_init(VirtIOS390Device *dev)