This makes the change HMP/QMP command on SD devices work again, after it has been broken in commit de2c6c0536c5c5ebb6e0ce7dcfd8fa9476edab52.
Reported-by: Peter Maydell <[email protected]> Cc: qemu-stable <[email protected]> Signed-off-by: Max Reitz <[email protected]> --- 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
