aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x/s390-virtio-bus.c
diff options
context:
space:
mode:
authorKONRAD Frederic <fred.konrad@greensocs.com>2013-04-30 16:08:51 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2013-05-03 12:05:15 -0500
commit6f32a6b47ef4247ad14dad63c6ee231fdce4c5e9 (patch)
tree8df753bc784568705a858c9736cc11d7215e4cd0 /hw/s390x/s390-virtio-bus.c
parent80270a19685dd20eda017b0360c743b3e3ed6f57 (diff)
virtio-scsi: fix the 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-6-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/s390x/s390-virtio-bus.c')
-rw-r--r--hw/s390x/s390-virtio-bus.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
index 83faf97ea7..5a3d97c037 100644
--- a/hw/s390x/s390-virtio-bus.c
+++ b/hw/s390x/s390-virtio-bus.c
@@ -235,6 +235,18 @@ static int s390_virtio_scsi_init(VirtIOS390Device *s390_dev)
{
VirtIOSCSIS390 *dev = VIRTIO_SCSI_S390(s390_dev);
DeviceState *vdev = DEVICE(&dev->vdev);
+ DeviceState *qdev = DEVICE(s390_dev);
+ char *bus_name;
+
+ /*
+ * For command line compatibility, this sets the virtio-scsi-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) {