diff options
author | Markus Armbruster <armbru@redhat.com> | 2010-06-29 16:58:30 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2010-07-02 13:18:02 +0200 |
commit | 18846dee1a795b4345ac0bd10b70a3a46fd14287 (patch) | |
tree | ae5d0224a6e9733c38835c39fab70e5f42393867 /block_int.h | |
parent | dfb0acd88782573e075251ef323e23a4bffdbf93 (diff) |
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>
Diffstat (limited to 'block_int.h')
-rw-r--r-- | block_int.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/block_int.h b/block_int.h index e60aed4a04..a94b80152f 100644 --- a/block_int.h +++ b/block_int.h @@ -148,6 +148,8 @@ struct BlockDriverState { BlockDriver *drv; /* NULL means no media */ void *opaque; + DeviceState *peer; + char filename[1024]; char backing_file[1024]; /* if non zero, the image is a diff of this file image */ |