From 6f32a6b47ef4247ad14dad63c6ee231fdce4c5e9 Mon Sep 17 00:00:00 2001 From: KONRAD Frederic Date: Tue, 30 Apr 2013 16:08:51 +0200 Subject: 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 Tested-by: Cornelia Huck Message-id: 1367330931-12994-6-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori --- hw/s390x/virtio-ccw.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'hw/s390x/virtio-ccw.c') diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 4ebefd886b..76e6d32b72 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -680,6 +680,18 @@ static int virtio_ccw_scsi_init(VirtioCcwDevice *ccw_dev) { VirtIOSCSICcw *dev = VIRTIO_SCSI_CCW(ccw_dev); DeviceState *vdev = DEVICE(&dev->vdev); + DeviceState *qdev = DEVICE(ccw_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(&ccw_dev->bus)); if (qdev_init(vdev) < 0) { -- cgit v1.2.1