From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwsmX-0004ZM-R2 for qemu-devel@nongnu.org; Fri, 05 Dec 2014 08:18:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XwsmR-00041X-LT for qemu-devel@nongnu.org; Fri, 05 Dec 2014 08:18:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46332) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwsmR-00041R-DA for qemu-devel@nongnu.org; Fri, 05 Dec 2014 08:18:43 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sB5DIgJq008434 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 5 Dec 2014 08:18:42 -0500 Message-ID: <5481B0AF.409@redhat.com> Date: Fri, 05 Dec 2014 14:18:39 +0100 From: Max Reitz MIME-Version: 1.0 References: <1417774136-30001-1-git-send-email-mreitz@redhat.com> <1417774136-30001-2-git-send-email-mreitz@redhat.com> <5481AEC7.2010107@redhat.com> In-Reply-To: <5481AEC7.2010107@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 1/4] qmp: Introduce blockdev-change-medium List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: Kevin Wolf , Markus Armbruster , Stefan Hajnoczi , Luiz Capitulino On 2014-12-05 at 14:10, Eric Blake wrote: > On 12/05/2014 03:08 AM, Max Reitz wrote: >> 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.c | 7 ++++--- >> include/sysemu/blockdev.h | 2 -- >> qapi/block-core.json | 21 +++++++++++++++++++++ >> qmp-commands.hx | 31 +++++++++++++++++++++++++++++++ >> qmp.c | 2 +- >> 5 files changed, 57 insertions(+), 6 deletions(-) > I like it! Good :-) >> >> ## >> +# @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. >> +# >> +# @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.3 >> +## >> +{ 'command': 'blockdev-change-medium', >> + 'data': { 'device': 'str', >> + 'filename': 'str', >> + '*format': 'str' } } > Someday, we should quit open-coding format as 'str' and instead make it > an enum; but that is a separate patch series, and can get this location > as part of that series. > > Should there be a way to empty a cdrom drive? That is, how do I change > a drive from visiting a file to being empty? Doesn't 'eject' work? > Does passing the empty > string for mandatory 'filename' do that, or should we be strict and > state that filename is optional (omit to empty the drive) and that an > empty string as filename is forbidden? > > Please also improve the documentation in qapi-schema.json to have the > 'change' command mention that it is kept for backwards compatibility, > but that it is no longer the preferred command and point users to > 'blockdev-change-medium'. And to 'change-vnc-password'. Will do. Max