qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-stable@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	Max Reitz <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH 2/2] hw/sd: Implement is_tray_open() BlockDevOp
Date: Thu,  7 Jan 2016 22:03:28 +0100	[thread overview]
Message-ID: <1452200608-524-3-git-send-email-mreitz@redhat.com> (raw)
In-Reply-To: <1452200608-524-1-git-send-email-mreitz@redhat.com>

This makes the change HMP/QMP command on SD devices work again, after it
has been broken in commit de2c6c0536c5c5ebb6e0ce7dcfd8fa9476edab52.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-stable <qemu-stable@nongnu.org>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 hw/sd/sd.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 0751ba2..7d1e1cb 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -439,8 +439,15 @@ static void sd_cardchange(void *opaque, bool load)
     }
 }
 
+static bool sd_is_tray_open(void *opaque)
+{
+    SDState *sd = opaque;
+    return !sd->medium_inserted;
+}
+
 static const BlockDevOps sd_block_ops = {
     .change_media_cb = sd_cardchange,
+    .is_tray_open = sd_is_tray_open,
 };
 
 static const VMStateDescription sd_vmstate = {
-- 
2.6.4

      parent reply	other threads:[~2016-01-07 21:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07 21:03 [Qemu-devel] [PATCH 0/2] hw/sd: Fix medium change Max Reitz
2016-01-07 21:03 ` [Qemu-devel] [PATCH 1/2] hw/sd: Add medium insertion status Max Reitz
2016-01-07 21:38   ` John Snow
2016-01-07 21:45   ` Peter Maydell
2016-01-07 22:00     ` Max Reitz
2016-01-07 21:03 ` Max Reitz [this message]

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=1452200608-524-3-git-send-email-mreitz@redhat.com \
    --to=mreitz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=stefanha@redhat.com \
    /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).