diff options
author | Andreas Färber <afaerber@suse.de> | 2013-07-30 05:30:09 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-12-09 21:46:49 +0100 |
commit | b1a20c3fcab96832c3813e9e7162748f325e0c82 (patch) | |
tree | ce16789bb11501c5eac4cc56fa88bc6cb9aff548 /hw/char | |
parent | 179b417e17ada41dce4e8112bea0a78a70b6162c (diff) |
virtio-serial: QOM realize preparations
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/char')
-rw-r--r-- | hw/char/virtio-serial-bus.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c index a7ede90ec1..313a5d89bb 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) { @@ -912,8 +913,9 @@ static int virtio_serial_device_init(VirtIODevice *vdev) /* Spawn a new virtio-serial bus on which the ports will ride as devices */ qbus_create_inplace(&vser->bus, sizeof(vser->bus), TYPE_VIRTIO_SERIAL_BUS, - qdev, vdev->bus_name); - vser->bus.qbus.allow_hotplug = 1; + dev, vdev->bus_name); + 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; |