diff options
Diffstat (limited to 'hw/s390x/s390-virtio-bus.c')
-rw-r--r-- | hw/s390x/s390-virtio-bus.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c index d52a54725f..83faf97ea7 100644 --- a/hw/s390x/s390-virtio-bus.c +++ b/hw/s390x/s390-virtio-bus.c @@ -197,9 +197,20 @@ static int s390_virtio_serial_init(VirtIOS390Device *s390_dev) DeviceState *qdev = DEVICE(s390_dev); VirtIOS390Bus *bus; int r; + char *bus_name; bus = DO_UPCAST(VirtIOS390Bus, bus, qdev->parent_bus); + /* + * For command line compatibility, this sets the virtio-serial-device bus + * name as before. + */ + if (qdev->id) { + bus_name = g_strdup_printf("%s.0", qdev->id); + virtio_device_set_child_bus_name(VIRTIO_DEVICE(vdev), bus_name); + g_free(bus_name); + } + qdev_set_parent_bus(vdev, BUS(&s390_dev->bus)); if (qdev_init(vdev) < 0) { return -1; |