'change' and related operations did not work when used on guest devices
featuring removable media but no actual tray, because
blk_dev_is_tray_open() always returned false for them and the
blockdev-{insert,remove}-medium commands required it to return true.
Fix this by making blockdev-{insert,remove}-medium work on tray-less
devices. Also, blockdev-{open,close}-tray are now explicitly no-ops when
invoked on such devices, and blk_dev_change_media_cb() is instead
called by blockdev-{insert,remove}-medium (for tray-less devices only).
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-stable <qemu-stable@nongnu.org>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-id: 1454096953-31773-3-git-send-email-mreitz@redhat.com
Reviewed-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| Makefile.objs | ||
| block-core.json | ||
| block.json | ||
| common.json | ||
| crypto.json | ||
| event.json | ||
| introspect.json | ||
| opts-visitor.c | ||
| qapi-dealloc-visitor.c | ||
| qapi-util.c | ||
| qapi-visit-core.c | ||
| qmp-dispatch.c | ||
| qmp-event.c | ||
| qmp-input-visitor.c | ||
| qmp-output-visitor.c | ||
| qmp-registry.c | ||
| rocker.json | ||
| string-input-visitor.c | ||
| string-output-visitor.c | ||
| trace.json | ||