[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 28/39] blockdev: Add blockdev-open-tray
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v7 28/39] blockdev: Add blockdev-open-tray |
Date: |
Fri, 23 Oct 2015 15:22:59 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 19.10.2015 um 17:53 hat Max Reitz geschrieben:
> Signed-off-by: Max Reitz <address@hidden>
> ---
> blockdev.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
> qapi/block-core.json | 23 +++++++++++++++++++++++
> qmp-commands.hx | 39 +++++++++++++++++++++++++++++++++++++++
> 3 files changed, 111 insertions(+)
> +
> + if (blk_dev_is_medium_locked(blk)) {
> + blk_dev_eject_request(blk, force);
> + } else {
> + blk_dev_change_media_cb(blk, false);
> + }
This seems to be inconsistent with the command documentation: In the
case of a forced eject request, the tray is just unlocked, but not
opened.
> +##
> +# @blockdev-open-tray:
> +#
> +# Opens a block device's tray. If there is a block driver state tree
> inserted as
> +# a medium, it will become inaccessible to the guest (but it will remain
> +# associated to the block device, so closing the tray will make it accessible
> +# again).
> +#
> +# If the tray was already open before, this will be a no-op.
> +#
> +# @device: block device name
> +#
> +# @force: #optional if false (the default), an eject request will be sent to
> +# the guest if it has locked the tray (and the tray will not be
> opened
> +# immediately); if true, the tray will be opened regardless of
> whether
> +# it is locked
> +#
> +# Since: 2.5
> +##
> +{ 'command': 'blockdev-open-tray',
> + 'data': { 'device': 'str',
> + '*force': 'bool' } }
This API makes it impossible for the management application to know
whether the tray has actually been opened or just an eject request has
been made.
Is the expected use that management sets a timeout and waits for a
tray opened event? If so, worth documenting?
Kevin
- [Qemu-devel] [PATCH v7 18/39] block: Add BlockBackendRootState, (continued)
- [Qemu-devel] [PATCH v7 18/39] block: Add BlockBackendRootState, Max Reitz, 2015/10/19
- [Qemu-devel] [PATCH v7 16/39] block: Move I/O status and error actions into BB, Max Reitz, 2015/10/19
- [Qemu-devel] [PATCH v7 19/39] block: Make some BB functions fall back to BBRS, Max Reitz, 2015/10/19
- [Qemu-devel] [PATCH v7 21/39] block: Prepare remaining BB functions for NULL BDS, Max Reitz, 2015/10/19
- [Qemu-devel] [PATCH v7 22/39] block: Add blk_insert_bs(), Max Reitz, 2015/10/19
- [Qemu-devel] [PATCH v7 20/39] block: Fail requests to empty BlockBackend, Max Reitz, 2015/10/19
- [Qemu-devel] [PATCH v7 24/39] blockdev: Do not create BDS for empty drive, Max Reitz, 2015/10/19
- [Qemu-devel] [PATCH v7 23/39] block: Prepare for NULL BDS, Max Reitz, 2015/10/19
- [Qemu-devel] [PATCH v7 25/39] blockdev: Pull out blockdev option extraction, Max Reitz, 2015/10/19
- [Qemu-devel] [PATCH v7 28/39] blockdev: Add blockdev-open-tray, Max Reitz, 2015/10/19
[Qemu-devel] [PATCH v7 27/39] block: Add blk_remove_bs(), Max Reitz, 2015/10/19
[Qemu-devel] [PATCH v7 26/39] blockdev: Allow more options for BB-less BDS tree, Max Reitz, 2015/10/19