qemu-e2k/hw/scsi
Markus Armbruster 26f8b3a847 blockdev: Fix blockdev-add not to create DriveInfo
blockdev_init() always creates a DriveInfo, but only drive_new() fills
it in.  qmp_blockdev_add() leaves it blank.  This results in a drive
with type = IF_IDE, bus = 0, unit = 0.  Screwed up in commit ee13ed1c.

Board initialization code looking for IDE drive (0,0) can pick up one
of these bogus drives.  The QMP command has to execute really early to
be visible.  Not sure how likely that is in practice.

Fix by creating DriveInfo in drive_new().  Block backends created by
blockdev-add don't get one.

Breaks the test for "has been created by qmp_blockdev_add()" in
blockdev_mark_auto_del() and do_drive_del(), because it changes the
value of dinfo && !dinfo->enable_auto_del from true to false.  Simply
test !dinfo instead.

Leaves DriveInfo member enable_auto_del unused.  Drop it.

A few places assume a block backend always has a DriveInfo.  Fix them
up.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-10-20 14:03:50 +02:00
..
esp-pci.c
esp.c
lsi53c895a.c scsi-bus: Convert DeviceClass init to realize 2014-08-26 13:20:44 +02:00
Makefile.objs virtio-scsi-dataplane: Code to run virtio-scsi on iothread 2014-09-30 11:11:20 +02:00
megasas.c hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
mfi.h
scsi-bus.c hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
scsi-disk.c blockdev: Fix blockdev-add not to create DriveInfo 2014-10-20 14:03:50 +02:00
scsi-generic.c hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
spapr_vscsi.c scsi: Drop scsi_req_abort 2014-09-30 13:30:50 +02:00
srp.h
vhost-scsi.c vhost-scsi: use virtio_ldl_p 2014-09-23 15:40:51 +02:00
viosrp.h
virtio-scsi-dataplane.c hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
virtio-scsi.c hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
vmw_pvscsi.c scsi: Convert pvscsi HBA to hotplug handler API 2014-10-15 05:03:14 +02:00
vmw_pvscsi.h