Revision 80270a19

b/hw/char/virtio-serial-bus.c
911 911
                sizeof(struct virtio_console_config));
912 912

  
913 913
    /* Spawn a new virtio-serial bus on which the ports will ride as devices */
914
    qbus_create_inplace(&vser->bus.qbus, TYPE_VIRTIO_SERIAL_BUS, qdev, NULL);
914
    qbus_create_inplace(&vser->bus.qbus, TYPE_VIRTIO_SERIAL_BUS, qdev,
915
                        vdev->bus_name);
915 916
    vser->bus.qbus.allow_hotplug = 1;
916 917
    vser->bus.vser = vser;
917 918
    QTAILQ_INIT(&vser->ports);
b/hw/s390x/s390-virtio-bus.c
197 197
    DeviceState *qdev = DEVICE(s390_dev);
198 198
    VirtIOS390Bus *bus;
199 199
    int r;
200
    char *bus_name;
200 201

  
201 202
    bus = DO_UPCAST(VirtIOS390Bus, bus, qdev->parent_bus);
202 203

  
204
    /*
205
     * For command line compatibility, this sets the virtio-serial-device bus
206
     * name as before.
207
     */
208
    if (qdev->id) {
209
        bus_name = g_strdup_printf("%s.0", qdev->id);
210
        virtio_device_set_child_bus_name(VIRTIO_DEVICE(vdev), bus_name);
211
        g_free(bus_name);
212
    }
213

  
203 214
    qdev_set_parent_bus(vdev, BUS(&s390_dev->bus));
204 215
    if (qdev_init(vdev) < 0) {
205 216
        return -1;
b/hw/s390x/virtio-ccw.c
593 593
{
594 594
    VirtioSerialCcw *dev = VIRTIO_SERIAL_CCW(ccw_dev);
595 595
    DeviceState *vdev = DEVICE(&dev->vdev);
596
    DeviceState *proxy = DEVICE(ccw_dev);
597
    char *bus_name;
598

  
599
    /*
600
     * For command line compatibility, this sets the virtio-serial-device bus
601
     * name as before.
602
     */
603
    if (proxy->id) {
604
        bus_name = g_strdup_printf("%s.0", proxy->id);
605
        virtio_device_set_child_bus_name(VIRTIO_DEVICE(vdev), bus_name);
606
        g_free(bus_name);
607
    }
596 608

  
597 609
    qdev_set_parent_bus(vdev, BUS(&ccw_dev->bus));
598 610
    if (qdev_init(vdev) < 0) {
b/hw/virtio/virtio-pci.c
1297 1297
{
1298 1298
    VirtIOSerialPCI *dev = VIRTIO_SERIAL_PCI(vpci_dev);
1299 1299
    DeviceState *vdev = DEVICE(&dev->vdev);
1300
    DeviceState *proxy = DEVICE(vpci_dev);
1301
    char *bus_name;
1300 1302

  
1301 1303
    if (vpci_dev->class_code != PCI_CLASS_COMMUNICATION_OTHER &&
1302 1304
        vpci_dev->class_code != PCI_CLASS_DISPLAY_OTHER && /* qemu 0.10 */
......
1310 1312
        vpci_dev->nvectors = dev->vdev.serial.max_virtserial_ports + 1;
1311 1313
    }
1312 1314

  
1315
    /*
1316
     * For command line compatibility, this sets the virtio-serial-device bus
1317
     * name as before.
1318
     */
1319
    if (proxy->id) {
1320
        bus_name = g_strdup_printf("%s.0", proxy->id);
1321
        virtio_device_set_child_bus_name(VIRTIO_DEVICE(vdev), bus_name);
1322
        g_free(bus_name);
1323
    }
1324

  
1313 1325
    qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus));
1314 1326
    if (qdev_init(vdev) < 0) {
1315 1327
        return -1;

Also available in: Unified diff