Received: from eggs.gnu.org ([2001:4830:134:3::10]:34052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpdHo-0007YJ-T8 for qemu-devel@nongnu.org; Fri, 23 Oct 2015 10:25:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpdHk-0002pN-S6 for qemu-devel@nongnu.org; Fri, 23 Oct 2015 10:25:40 -0400 Date: Fri, 23 Oct 2015 16:25:23 +0200 From: Kevin Wolf Message-ID: <20151023142523.GK3797@noname.redhat.com> References: <1445270025-22999-1-git-send-email-mreitz@redhat.com> <1445270025-22999-36-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1445270025-22999-36-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v7 35/39] qmp: Introduce blockdev-change-medium List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Alberto Garcia , qemu-block@nongnu.org, John Snow , qemu-devel@nongnu.org, Markus Armbruster , Stefan Hajnoczi 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 > ## > +# @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