block: Catch attempt to attach multiple devices to a blockdev
commit18846dee1a795b4345ac0bd10b70a3a46fd14287
authorMarkus Armbruster <armbru@redhat.com>
Tue, 29 Jun 2010 14:58:30 +0000 (29 16:58 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 2 Jul 2010 11:18:02 +0000 (2 13:18 +0200)
treeae5d0224a6e9733c38835c39fab70e5f42393867
parentdfb0acd88782573e075251ef323e23a4bffdbf93
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 <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
block.h
block_int.h
hw/fdc.c
hw/ide/qdev.c
hw/pci-hotplug.c
hw/qdev-properties.c
hw/qdev.h
hw/s390-virtio.c
hw/scsi-bus.c
hw/usb-msd.c