qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-stable] [PATCH 2/2] hw/sd: Implement is_tray_open() BlockDevOp


From: Max Reitz
Subject: [Qemu-stable] [PATCH 2/2] hw/sd: Implement is_tray_open() BlockDevOp
Date: Thu, 7 Jan 2016 22:03:28 +0100

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

Reported-by: Peter Maydell <address@hidden>
Cc: qemu-stable <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]