diff options
author | KONRAD Frederic | 2013-04-30 16:08:50 +0200 |
---|---|---|
committer | Anthony Liguori | 2013-05-03 19:05:15 +0200 |
commit | 80270a19685dd20eda017b0360c743b3e3ed6f57 (patch) | |
tree | 6a4dff1fdaf9456e6350f3a2270cc25a8a186a3f /hw/s390x/virtio-ccw.c | |
parent | scsi: add bus_name parameter to scsi_bus_new. (diff) | |
download | qemu-80270a19685dd20eda017b0360c743b3e3ed6f57.tar.gz qemu-80270a19685dd20eda017b0360c743b3e3ed6f57.tar.xz qemu-80270a19685dd20eda017b0360c743b3e3ed6f57.zip |
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 <fred.konrad@greensocs.com>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Message-id: 1367330931-12994-5-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/s390x/virtio-ccw.c')
-rw-r--r-- | hw/s390x/virtio-ccw.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index ef9908001d..4ebefd886b 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -593,6 +593,18 @@ static int virtio_ccw_serial_init(VirtioCcwDevice *ccw_dev) { VirtioSerialCcw *dev = VIRTIO_SERIAL_CCW(ccw_dev); DeviceState *vdev = DEVICE(&dev->vdev); + DeviceState *proxy = DEVICE(ccw_dev); + char *bus_name; + + /* + * 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(&ccw_dev->bus)); if (qdev_init(vdev) < 0) { |