From: KONRAD Frederic <fred.kon...@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.kon...@greensocs.com> --- hw/s390-virtio-bus.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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) -- 1.7.11.7