qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH for-next v2 10/22] virtio-serial: QOM realize prepar


From: Andreas Färber
Subject: [Qemu-devel] [PATCH for-next v2 10/22] virtio-serial: QOM realize preparations
Date: Thu, 1 Aug 2013 04:17:31 +0200

Signed-off-by: Andreas Färber <address@hidden>
---
 hw/char/virtio-serial-bus.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
index da417c7..a82786b 100644
--- a/hw/char/virtio-serial-bus.c
+++ b/hw/char/virtio-serial-bus.c
@@ -891,8 +891,9 @@ static int virtser_port_qdev_exit(DeviceState *qdev)
 
 static int virtio_serial_device_init(VirtIODevice *vdev)
 {
-    DeviceState *qdev = DEVICE(vdev);
-    VirtIOSerial *vser = VIRTIO_SERIAL(vdev);
+    DeviceState *dev = DEVICE(vdev);
+    VirtIOSerial *vser = VIRTIO_SERIAL(dev);
+    BusState *bus;
     uint32_t i, max_supported_ports;
 
     if (!vser->serial.max_virtserial_ports) {
@@ -911,9 +912,10 @@ static int virtio_serial_device_init(VirtIODevice *vdev)
                 sizeof(struct virtio_console_config));
 
     /* Spawn a new virtio-serial bus on which the ports will ride as devices */
-    qbus_create_inplace(&vser->bus.qbus, TYPE_VIRTIO_SERIAL_BUS, qdev,
+    qbus_create_inplace(&vser->bus, TYPE_VIRTIO_SERIAL_BUS, dev,
                         vdev->bus_name);
-    vser->bus.qbus.allow_hotplug = 1;
+    bus = BUS(&vser->bus);
+    bus->allow_hotplug = 1;
     vser->bus.vser = vser;
     QTAILQ_INIT(&vser->ports);
 
@@ -961,7 +963,7 @@ static int virtio_serial_device_init(VirtIODevice *vdev)
      * Register for the savevm section with the virtio-console name
      * to preserve backward compat
      */
-    register_savevm(qdev, "virtio-console", -1, 3, virtio_serial_save,
+    register_savevm(dev, "virtio-console", -1, 3, virtio_serial_save,
                     virtio_serial_load, vser);
 
     return 0;
-- 
1.8.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]