From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xwsed-0007Th-NU for qemu-devel@nongnu.org; Fri, 05 Dec 2014 08:10:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XwseY-0007Os-Lq for qemu-devel@nongnu.org; Fri, 05 Dec 2014 08:10:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41171) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwseY-0007OC-CT for qemu-devel@nongnu.org; Fri, 05 Dec 2014 08:10:34 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sB5DAW1V015722 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 5 Dec 2014 08:10:33 -0500 Message-ID: <5481AEC7.2010107@redhat.com> Date: Fri, 05 Dec 2014 06:10:31 -0700 From: Eric Blake MIME-Version: 1.0 References: <1417774136-30001-1-git-send-email-mreitz@redhat.com> <1417774136-30001-2-git-send-email-mreitz@redhat.com> In-Reply-To: <1417774136-30001-2-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gBlFJ49hm91rXwoP55Sc75RqdWhXjQosB" 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: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Markus Armbruster , Stefan Hajnoczi , Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gBlFJ49hm91rXwoP55Sc75RqdWhXjQosB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 functio= n > qmp_change_blockdev() is accordingly renamed to > qmp_blockdev_change_medium(). >=20 > 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! > =20 > ## > +# @blockdev-change-medium: > +# > +# Changes the medium inserted into a block device by ejecting the curr= ent 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? 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'. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --gBlFJ49hm91rXwoP55Sc75RqdWhXjQosB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUga7HAAoJEKeha0olJ0Nq2+0IAIqX97hmcEfjQ0ZsP7v8hrLl 6et/1yk8HKuLNeU77uMi5ZeUoiYslxafKY8MvqR8ILEiFsuJQ1GFofW9EB6TqtI+ dIo4mHsWpUMNsSBcJdxQEzEZ4rKsFr1cb/YCGIF++1/aHhW1OpZf8zuF34gU3viW D9FUlRxKvHAkaBvk2zYsn80bS/DV1Vum1MhGSc2FryomkMOABKm9X3231NKv91Ml QbCRI/MQPM8tWKhyT3Yb9cFRPiIcVfcikJLh8rj33n3LuExEQKdQYVN9uw790PUt apUiT+mksAl4ZdjZEvB1KzQ7NPrLq6fxpc9hjE1/WFMlwjVE09jWMNby2mUU0/Y= =wYbZ -----END PGP SIGNATURE----- --gBlFJ49hm91rXwoP55Sc75RqdWhXjQosB--