[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v7 35/39] qmp: Introduce blockdev-change-medium
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-block] [PATCH v7 35/39] qmp: Introduce blockdev-change-medium |
Date: |
Fri, 23 Oct 2015 16:25:23 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 19.10.2015 um 17:53 hat Max Reitz geschrieben:
> Introduce a new QMP command 'blockdev-change-medium' which is intended
> to replace the 'change' command for block devices. The existing function
> qmp_change_blockdev() is accordingly renamed to
> qmp_blockdev_change_medium().
>
> Signed-off-by: Max Reitz <address@hidden>
> ##
> +# @blockdev-change-medium:
> +#
> +# Changes the medium inserted into a block device by ejecting the current
> medium
> +# and loading a new image file which is inserted as the new medium (this
> command
> +# combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium
> +# and blockdev-close-tray).
> +#
> +# @device: block device name
> +#
> +# @filename: filename of the new image to be loaded
> +#
> +# @format: #optional, format to open the new image with (defaults to
> +# the probed format)
> +#
> +# Since: 2.5
> +##
> +{ 'command': 'blockdev-change-medium',
> + 'data': { 'device': 'str',
> + 'filename': 'str',
> + '*format': 'str' } }
Do we really want to expose such an interface in a new QMP command? It
isn't like blockdev-add, but like -hda. Which doesn't only mean that you
can't specify most options, but also that filename is parsed for
protocol names etc.
Shouldn't new clients use blockdev-add and the separate tray-open/close
and remove/insert-medium commands instead of converting from one bad
commannd (change) to another (this one)?
Or, if we really want to provide a convenience function, this should
probably take a BlockdevRef instead of filename/format.
Kevin
- Re: [Qemu-block] [PATCH v7 31/39] blockdev: Add blockdev-insert-medium, (continued)
- [Qemu-block] [PATCH v7 32/39] blockdev: Implement eject with basic operations, Max Reitz, 2015/10/19
- [Qemu-block] [PATCH v7 33/39] blockdev: Implement change with basic operations, Max Reitz, 2015/10/19
- [Qemu-block] [PATCH v7 34/39] block: Inquire tray state before tray-moved events, Max Reitz, 2015/10/19
- [Qemu-block] [PATCH v7 35/39] qmp: Introduce blockdev-change-medium, Max Reitz, 2015/10/19
- [Qemu-block] [PATCH v7 36/39] hmp: Use blockdev-change-medium for change command, Max Reitz, 2015/10/19
- [Qemu-block] [PATCH v7 37/39] blockdev: read-only-mode for blockdev-change-medium, Max Reitz, 2015/10/19
- [Qemu-block] [PATCH v7 38/39] hmp: Add read-only-mode option to change command, Max Reitz, 2015/10/19
- [Qemu-block] [PATCH v7 39/39] iotests: Add test for change-related QMP commands, Max Reitz, 2015/10/19