Patchwork [07/61] virtio-s390-device : create a virtio-s390-bus during init.

login
register
mail settings
Submitter fred.konrad@greensocs.com
Date Jan. 7, 2013, 6:40 p.m.
Message ID <1357584074-10852-8-git-send-email-fred.konrad@greensocs.com>
Download mbox | patch
Permalink /patch/210093/
State New
Headers show

Comments

fred.konrad@greensocs.com - Jan. 7, 2013, 6:40 p.m.
From: KONRAD Frederic <fred.konrad@greensocs.com>

A virtio-s390-bus is created during the init. So one VirtIODevice can be
connected on the virtio-s390-device through this bus.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
---
 hw/s390-virtio-bus.c | 2 ++
 hw/s390-virtio-bus.h | 1 +
 2 files changed, 3 insertions(+)

Patch

diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c
index 0fa0a74..946de31 100644
--- a/hw/s390-virtio-bus.c
+++ b/hw/s390-virtio-bus.c
@@ -503,6 +503,8 @@  static int s390_virtio_busdev_init(DeviceState *dev)
     VirtIOS390Device *_dev = (VirtIOS390Device *)dev;
     VirtIOS390DeviceClass *_info = VIRTIO_S390_DEVICE_GET_CLASS(dev);
 
+    _dev->bus = virtio_s390_bus_new(_dev);
+
     return _info->init(_dev);
 }
 
diff --git a/hw/s390-virtio-bus.h b/hw/s390-virtio-bus.h
index 81af7a0..178e281 100644
--- a/hw/s390-virtio-bus.h
+++ b/hw/s390-virtio-bus.h
@@ -92,6 +92,7 @@  struct VirtIOS390Device {
     virtio_net_conf net;
     VirtIOSCSIConf scsi;
     VirtIORNGConf rng;
+    VirtioBusState *bus;
 };
 
 typedef struct VirtIOS390Bus {