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 <mre...@redhat.com>
> ## > +# @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