From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xwsi9-00012R-Q8 for qemu-devel@nongnu.org; Fri, 05 Dec 2014 08:14:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xwsi4-0000wL-Rw for qemu-devel@nongnu.org; Fri, 05 Dec 2014 08:14:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xwsi4-0000uu-LC for qemu-devel@nongnu.org; Fri, 05 Dec 2014 08:14:12 -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 sB5DEBrf031206 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 5 Dec 2014 08:14:11 -0500 Message-ID: <5481AFA2.2040507@redhat.com> Date: Fri, 05 Dec 2014 06:14:10 -0700 From: Eric Blake MIME-Version: 1.0 References: <1417774136-30001-1-git-send-email-mreitz@redhat.com> In-Reply-To: <1417774136-30001-1-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jHiWisikKNgrqvOmtpHG29FE8SmUvNJCW" Subject: Re: [Qemu-devel] [PATCH v2 0/4] blockdev: Add blockdev-change-medium with read-only option 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) --jHiWisikKNgrqvOmtpHG29FE8SmUvNJCW Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/05/2014 03:08 AM, Max Reitz wrote: > The 'change' QMP and HMP command allows replacing the medium in drives > which support this, e.g. floppy disk drives. For some drives, the mediu= m > carries information about whether it can be written to or not (again, > floppy drives). Therefore, it should be possible to change the read-onl= y > state of block devices when changing the loaded medium. >=20 > Following a suggestion from Eric, this series first introduces a > 'blockdev-change-medium' QMP command which is intended to replace the > 'change' command for block devices. Then, an optional additional > 'read-only' parameter is added which allows chaning the read-only state= s/chaning/changing/ (I first read it as chaining) - of course, typos in cover letters don't really matter in the long run :) > in three ways: >=20 > - 'retain': Just keep the status as it was before; this is the current > behavior and thus this will be the default. > - 'ro': Force read-only access > - 'rw': Force writable access >=20 > Finally, that 'read-only' parameter is added to the HMP 'change' > command. This series does not add a 'blockdev-change-medium' QMP comman= d I assume you meant HMP in this line. > because 'change' being overloaded for VNC and block devices is not too > bad for HMP (while it is for QMP). I agree with that approach. >=20 >=20 > v2: > - basically completely rewritten > - Dropped 'auto' [Kevin and Markus] > - Introduced blockdev-change-medium [Eric] >=20 > - Patch 1 introduces the new QMP command 'blockdev-change-medium'; ther= e > are (at least) two questionable design choices which I want to explai= n > here: > - The name is rather long; furthermore, the name 'change-blockdev' wa= s > already suggested by the existing code. I used such a long name > because (1) there are no *-blockdev commands, but there are > blockdev-* commands, so "blockdev" should be the prefix, not the > suffix, and (2) "blockdev-change" could mean anything, so I wanted > to be as clear as possible. That's actually a good explanation; I'm fine with the name you ended up with, even if it feels long. > - The 'format' argument is optional; this is because by making it > mandatory, it would have been difficult for the 'change' QMP and HM= P > commands to retain their 'format' argument optional as well (which > we have to do thanks to compatibility) Yep, I can see that. On the other hand, the other questionable feature of 'change' was that it required a filename, but then allowed "" as the filename that meant no new medium. In patch 1/4, I wonder if we should make the new command a bit stricter, by having 'filename' be optional, and by forbidding "" as a filename (it's still a 1:1 mapping to the old semantics, and while it would require more HMP glue, it would feel a bit cleaner from the interface side). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --jHiWisikKNgrqvOmtpHG29FE8SmUvNJCW 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 iQEcBAEBCAAGBQJUga+iAAoJEKeha0olJ0NqTYQH/iyY4hIdEMMtfFu/O8hWuRNb fZ5hVYieqOg6cJ9ptoFEYpT5UlBzb5boHPuHitivdg3WaMhRK5jgrR+t16CpevZR /DvGulh0/NcJ3Vla9wcBA1mnhdkHumySh12IaLC0dSYpSAbaDwBQp4XitFEyAxkb jXnBWD61xM7cDmTE7vVvlF14hxBZvDS88zvfKli/TWOTV/mq+xt/nZD1eW1AcntC SIAsGCCgp6+EGQk9cOz4D18ziSzf/xNmFxvyIoL1CaIxyjQqR1CprkHUNnVfbz7U KYf8n4da0MXQX5w2E4mxCv2NVV2y9YF5dFPQZk4Nq4p70ILwexLRsxoch4my3bU= =joFQ -----END PGP SIGNATURE----- --jHiWisikKNgrqvOmtpHG29FE8SmUvNJCW--