From 18846dee1a795b4345ac0bd10b70a3a46fd14287 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 29 Jun 2010 16:58:30 +0200 Subject: block: Catch attempt to attach multiple devices to a blockdev For instance, -device scsi-disk,drive=foo -device scsi-disk,drive=foo happily creates two SCSI disks connected to the same block device. It's all downhill from there. Device usb-storage deliberately attaches twice to the same blockdev, which fails with the fix in place. Detach before the second attach there. Also catch attempt to delete while a guest device model is attached. Signed-off-by: Markus Armbruster Signed-off-by: Kevin Wolf --- hw/s390-virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/s390-virtio.c') diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c index c7c3fc9..6af58e2 100644 --- a/hw/s390-virtio.c +++ b/hw/s390-virtio.c @@ -262,7 +262,7 @@ static void s390_init(ram_addr_t ram_size, } dev = qdev_create((BusState *)s390_bus, "virtio-blk-s390"); - qdev_prop_set_drive(dev, "drive", dinfo->bdrv); + qdev_prop_set_drive_nofail(dev, "drive", dinfo->bdrv); qdev_init_nofail(dev); } } -- cgit v1.1