mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
hw: Mark devices picking up block backends actively FIXME
Drives defined with if!=none are for board initialization to wire up. Board code calls drive_get() or similar to find them, and creates devices with their qdev drive properties set accordingly. Except a few devices go on a fishing expedition for a suitable backend instead of exposing a drive property for board code to set: they call driver_get() or drive_get_next() in their realize() or init() method to implicitly connect to the "next" backend with a certain interface type. Picking up backends that way works when the devices are created by board code. But it's inappropriate for -device or device_add. Not only is this inconsistent with how the other block device models work (they connect to a backend explicitly identified by a "drive" property), it breaks when the "next" backend has been picked up by the board already. Example: $ qemu-system-arm -S -M connex -pflash flash.img -device ssi-sd Aborted (core dumped) Mark them with suitable FIXME comments. Cc: Andrzej Zaborowski <balrogg@gmail.com> Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Cc: "Andreas Färber" <andreas.faerber@web.de> Cc: Michael Walle <michael@walle.cc> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
b8a86c4ac4
commit
af9e40aa8f
7 changed files with 8 additions and 0 deletions
|
@ -319,11 +319,13 @@ static void pc87312_realize(DeviceState *dev, Error **errp)
|
|||
d = DEVICE(isa);
|
||||
qdev_prop_set_uint32(d, "iobase", get_fdc_iobase(s));
|
||||
qdev_prop_set_uint32(d, "irq", 6);
|
||||
/* FIXME use a qdev drive property instead of drive_get() */
|
||||
drive = drive_get(IF_FLOPPY, 0, 0);
|
||||
if (drive != NULL) {
|
||||
qdev_prop_set_drive_nofail(d, "driveA",
|
||||
blk_by_legacy_dinfo(drive));
|
||||
}
|
||||
/* FIXME use a qdev drive property instead of drive_get() */
|
||||
drive = drive_get(IF_FLOPPY, 0, 1);
|
||||
if (drive != NULL) {
|
||||
qdev_prop_set_drive_nofail(d, "driveB",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue