提交 b1a20c3f 编写于 作者: A Andreas Färber 提交者: Paolo Bonzini

virtio-serial: QOM realize preparations

Signed-off-by: NAndreas Färber <afaerber@suse.de>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 179b417e
...@@ -891,8 +891,9 @@ static int virtser_port_qdev_exit(DeviceState *qdev) ...@@ -891,8 +891,9 @@ static int virtser_port_qdev_exit(DeviceState *qdev)
static int virtio_serial_device_init(VirtIODevice *vdev) static int virtio_serial_device_init(VirtIODevice *vdev)
{ {
DeviceState *qdev = DEVICE(vdev); DeviceState *dev = DEVICE(vdev);
VirtIOSerial *vser = VIRTIO_SERIAL(vdev); VirtIOSerial *vser = VIRTIO_SERIAL(dev);
BusState *bus;
uint32_t i, max_supported_ports; uint32_t i, max_supported_ports;
if (!vser->serial.max_virtserial_ports) { if (!vser->serial.max_virtserial_ports) {
...@@ -912,8 +913,9 @@ static int virtio_serial_device_init(VirtIODevice *vdev) ...@@ -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 */ /* 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, qbus_create_inplace(&vser->bus, sizeof(vser->bus), TYPE_VIRTIO_SERIAL_BUS,
qdev, vdev->bus_name); dev, vdev->bus_name);
vser->bus.qbus.allow_hotplug = 1; bus = BUS(&vser->bus);
bus->allow_hotplug = 1;
vser->bus.vser = vser; vser->bus.vser = vser;
QTAILQ_INIT(&vser->ports); QTAILQ_INIT(&vser->ports);
...@@ -961,7 +963,7 @@ static int virtio_serial_device_init(VirtIODevice *vdev) ...@@ -961,7 +963,7 @@ static int virtio_serial_device_init(VirtIODevice *vdev)
* Register for the savevm section with the virtio-console name * Register for the savevm section with the virtio-console name
* to preserve backward compat * 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); virtio_serial_load, vser);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册