qemu-block
[Top][All Lists]
Advanced

[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



reply via email to

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