qemu-e2k/hw
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
..
9pfs hw/9pfs: Don't return type from host in readdir on local 9p filesystem 2014-09-04 10:51:13 -05:00
acpi qdev: HotplugHandler: Rename unplug callback to unplug_request 2014-10-15 05:03:13 +02:00
alpha ide: Update ide_drive_get to be HBA agnostic 2014-10-03 10:30:33 +01:00
arm hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
audio ac97: register reset via qom 2014-09-29 10:20:05 +02:00
block blockdev: Fix blockdev-add not to create DriveInfo 2014-10-20 14:03:50 +02:00
bt l2cap: fix access to freed memory 2014-08-15 19:12:48 +04:00
char virtio-serial: Convert to hotplug-handler API 2014-10-15 05:03:13 +02:00
core hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
cpu target-i386: ICC bus: Drop BusState::allow_hotplug 2014-10-15 05:03:13 +02:00
cris hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
display hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
dma hw/dma/i8257: Silence phony error message 2014-09-16 12:35:02 +02:00
gpio pl061: implement input interrupt logic 2014-09-12 14:06:48 +01:00
i2c Fix debug print warning 2014-09-02 22:38:16 +04:00
i386 hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
ide blockdev: Fix blockdev-add not to create DriveInfo 2014-10-20 14:03:50 +02:00
input hw/input/tsc210x.c: Delete unused array tsc2101_rates 2014-09-29 18:48:48 +01:00
intc hw/intc/imx_avic.c: Remove unused function imx_avic_set_prio() 2014-09-29 18:48:47 +01:00
ipack memory: remove memory_region_destroy 2014-08-18 12:06:21 +02:00
isa hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
lm32 hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
m68k memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
mem pc-dimm: Don't check dimm->node when there is non-NUMA config 2014-09-29 19:44:04 +03:00
microblaze hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
mips hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
misc bootindex: move calling add_boot_device_patch to bootindex setter function 2014-10-15 10:46:01 +02:00
moxie memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
net bootindex: move calling add_boot_device_patch to bootindex setter function 2014-10-15 10:46:01 +02:00
nvram hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
openrisc memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
pci hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
pci-bridge qdev: HotplugHandler: Rename unplug callback to unplug_request 2014-10-15 05:03:13 +02:00
pci-host - Memory: improve error reporting and avoid crashes on hotplug 2014-09-12 16:55:49 +01:00
pcmcia hw: Fix qemu_allocate_irqs() leaks 2014-06-30 21:13:30 +02:00
ppc hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
s390x hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
scsi blockdev: Fix blockdev-add not to create DriveInfo 2014-10-20 14:03:50 +02:00
sd hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
sh4 hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
sparc hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
sparc64 hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
ssi ssi: xilinx_spi: Initialise CS GPIOs as NULL 2014-08-15 18:54:40 +04:00
timer mc146818rtc: add missed field to vmstate 2014-09-11 12:20:32 +02:00
tpm hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
tricore hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
unicore32 memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
usb hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
virtio hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
watchdog memory: remove memory_region_destroy 2014-08-18 12:06:21 +02:00
xen hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
xenpv hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
xtensa hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
Makefile.objs pc: implement pc-dimm device abstraction 2014-06-19 16:41:47 +03:00