qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, peter.maydell@linaro.org
Subject: [Qemu-devel] [PATCH v2 for-2.3 4/5] sdhci: Make device "sdhci-pci" unavailable with -device
Date: Wed, 25 Mar 2015 15:16:08 +0100	[thread overview]
Message-ID: <1427292969-30929-5-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1427292969-30929-1-git-send-email-armbru@redhat.com>

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 <armbru@redhat.com>
---
 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

  parent reply	other threads:[~2015-03-25 14:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-25 14:16 [Qemu-devel] [PATCH v2 for-2.3 0/5] Contain drive, serial, parallel, net misuse Markus Armbruster
2015-03-25 14:16 ` [Qemu-devel] [PATCH v2 for-2.3 1/5] hw: Mark devices picking up block backends actively FIXME Markus Armbruster
2015-03-25 15:17   ` Andreas Färber
2015-03-25 15:18     ` Paolo Bonzini
2015-03-25 14:16 ` [Qemu-devel] [PATCH v2 for-2.3 2/5] hw: Mark devices picking up char " Markus Armbruster
2015-03-25 15:23   ` Andreas Färber
2015-03-25 14:16 ` [Qemu-devel] [PATCH v2 for-2.3 3/5] hw: Mark device misusing nd_table[] FIXME Markus Armbruster
2015-03-25 14:16 ` Markus Armbruster [this message]
2015-03-25 14:16 ` [Qemu-devel] [PATCH v2 for-2.3 5/5] sysbus: Make devices picking up backends unavailable with -device Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427292969-30929-5-git-send-email-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).