From af9e40aa8f36e30e89f16323b3d341ee59309b7e Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 23 Mar 2015 19:03:13 +0100 Subject: hw: Mark devices picking up block backends actively FIXME MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Cc: Peter Crosthwaite Cc: "Andreas Färber" Cc: Michael Walle Signed-off-by: Markus Armbruster --- hw/arm/spitz.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/arm') diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index a16831c2e5..da02932872 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -168,6 +168,7 @@ static int sl_nand_init(SysBusDevice *dev) DriveInfo *nand; s->ctl = 0; + /* FIXME use a qdev drive property instead of drive_get() */ nand = drive_get(IF_MTD, 0, 0); s->nand = nand_init(nand ? blk_by_legacy_dinfo(nand) : NULL, s->manf_id, s->chip_id); -- cgit v1.2.3