virtio-serial-bus: Fix bus initialisation and allow for bus identification

This commit enables one to use multiple virtio-serial devices and to
assign ports to arbitrary devices like this:

  -device virtio-serial,id=foo -device virtio-serial,id=bar \
  -device virtserialport,bus=foo.0,name=foo \
  -device virtserialport,bus=bar.0,name=bar

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Amit Shah 2010-01-27 21:52:19 +05:30 committed by Anthony Liguori
parent 794401ca9c
commit 9ae84f0a6d

View File

@ -445,8 +445,7 @@ static VirtIOSerialBus *virtser_bus_new(DeviceState *dev)
{
VirtIOSerialBus *bus;
bus = FROM_QBUS(VirtIOSerialBus, qbus_create(&virtser_bus_info, dev,
"virtio-serial-bus"));
bus = FROM_QBUS(VirtIOSerialBus, qbus_create(&virtser_bus_info, dev, NULL));
bus->qbus.allow_hotplug = 1;
return bus;