From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50513) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yam6T-0000TK-Uv for qemu-devel@nongnu.org; Wed, 25 Mar 2015 10:16:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yam6P-0007iZ-ML for qemu-devel@nongnu.org; Wed, 25 Mar 2015 10:16:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yam6P-0007iS-HY for qemu-devel@nongnu.org; Wed, 25 Mar 2015 10:16:13 -0400 From: Markus Armbruster Date: Wed, 25 Mar 2015 15:16:08 +0100 Message-Id: <1427292969-30929-5-git-send-email-armbru@redhat.com> In-Reply-To: <1427292969-30929-1-git-send-email-armbru@redhat.com> References: <1427292969-30929-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH v2 for-2.3 4/5] sdhci: Make device "sdhci-pci" unavailable with -device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, peter.maydell@linaro.org Device models aren't supposed to go on fishing expeditions for backends. They should expose suitable properties for the user to set. For onboard devices, board code sets them. "sdhci-pci" picks up its block backend in its realize() method with drive_get_next() instead. Already marked FIXME. See the commit that added the FIXME for a more detailed explanation of what's wrong. We can't fix this in time for the release, but since the device is new in 2.3, we can set cannot_instantiate_with_device_add_yet to disable it before this mistake becomes ABI, and we have to support command lines like $ qemu -drive if=sd -drive if=sd,file=sd.img -device sdhci-pci -device sdhci-pci forever. Signed-off-by: Markus Armbruster --- hw/sd/sdhci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index f056c52..ab13505 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -1254,6 +1254,8 @@ static void sdhci_pci_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); dc->vmsd = &sdhci_vmstate; dc->props = sdhci_properties; + /* Reason: realize() method uses drive_get_next() */ + dc->cannot_instantiate_with_device_add_yet = true; } static const TypeInfo sdhci_pci_info = { -- 1.9.3