From 80270a19685dd20eda017b0360c743b3e3ed6f57 Mon Sep 17 00:00:00 2001 From: KONRAD Frederic Date: Tue, 30 Apr 2013 16:08:50 +0200 Subject: virtio-serial: fix command line compatibility. The bus name is wrong since the refactoring. This keeps the behaviour of the command line. Signed-off-by: KONRAD Frederic Tested-by: Cornelia Huck Message-id: 1367330931-12994-5-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori --- hw/virtio/virtio-pci.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'hw/virtio') diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 070df44aad..abd2a3e551 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1297,6 +1297,8 @@ static int virtio_serial_pci_init(VirtIOPCIProxy *vpci_dev) { VirtIOSerialPCI *dev = VIRTIO_SERIAL_PCI(vpci_dev); DeviceState *vdev = DEVICE(&dev->vdev); + DeviceState *proxy = DEVICE(vpci_dev); + char *bus_name; if (vpci_dev->class_code != PCI_CLASS_COMMUNICATION_OTHER && vpci_dev->class_code != PCI_CLASS_DISPLAY_OTHER && /* qemu 0.10 */ @@ -1310,6 +1312,16 @@ static int virtio_serial_pci_init(VirtIOPCIProxy *vpci_dev) vpci_dev->nvectors = dev->vdev.serial.max_virtserial_ports + 1; } + /* + * For command line compatibility, this sets the virtio-serial-device bus + * name as before. + */ + if (proxy->id) { + bus_name = g_strdup_printf("%s.0", proxy->id); + virtio_device_set_child_bus_name(VIRTIO_DEVICE(vdev), bus_name); + g_free(bus_name); + } + qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus)); if (qdev_init(vdev) < 0) { return -1; -- cgit v1.2.3