diff mbox

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

Message ID 1264609339-24353-1-git-send-email-amit.shah@redhat.com
State New
Headers show

Commit Message

Amit Shah Jan. 27, 2010, 4:22 p.m. UTC
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>
---
 hw/virtio-serial-bus.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Comments

Markus Armbruster Jan. 28, 2010, 11:56 a.m. UTC | #1
Amit Shah <amit.shah@redhat.com> writes:

> 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>

Yes, please.  Without this, all virtio-serial devices name their bus the
same, and you have to use something like bus=pci.0/foo/virtio-serial-bus
to refer to one.
Anthony Liguori Jan. 29, 2010, 8:45 p.m. UTC | #2
On 01/27/2010 10:22 AM, Amit Shah wrote:
> 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>
>    

Applied.  Thanks.

Regards,

Anthony Liguori

> ---
>   hw/virtio-serial-bus.c |    3 +--
>   1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
> index 403268f..ab456ea 100644
> --- a/hw/virtio-serial-bus.c
> +++ b/hw/virtio-serial-bus.c
> @@ -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;
>
diff mbox

Patch

diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index 403268f..ab456ea 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -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;