From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGa3z-0004YY-HO for qemu-devel@nongnu.org; Wed, 28 Jan 2015 16:22:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGa3u-000477-Fr for qemu-devel@nongnu.org; Wed, 28 Jan 2015 16:22:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGa3u-000472-8O for qemu-devel@nongnu.org; Wed, 28 Jan 2015 16:22:10 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0SLM91l009535 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 28 Jan 2015 16:22:09 -0500 Message-ID: <54C952FF.5060601@redhat.com> Date: Wed, 28 Jan 2015 16:22:07 -0500 From: Max Reitz MIME-Version: 1.0 References: <1422387983-32153-1-git-send-email-mreitz@redhat.com> <1422387983-32153-48-git-send-email-mreitz@redhat.com> <54C94FE9.30709@redhat.com> In-Reply-To: <54C94FE9.30709@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RESEND 47/50] blockdev: Add read-only option to 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 , Fam Zheng , Jeff Cody , Markus Armbruster , Stefan Hajnoczi , John Snow On 2015-01-28 at 16:08, Eric Blake wrote: > On 01/27/2015 12:46 PM, Max Reitz wrote: >> Add an option to qmp_blockdev_change_medium() which allows changing the >> read-only status of the block device whose medium is changed. >> >> Some drives do not have a inherently fixed read-only status; for >> instance, floppy disks can be set read-only or writable independently of >> the drive. Some users may find it useful to be able to therefore change >> the read-only status of a block device when changing the medium. >> >> Signed-off-by: Max Reitz >> --- >> blockdev.c | 25 ++++++++++++++++++++++++- >> hmp.c | 2 +- >> qapi/block-core.json | 24 +++++++++++++++++++++++- >> qmp-commands.hx | 24 +++++++++++++++++++++++- >> qmp.c | 3 ++- >> 5 files changed, 73 insertions(+), 5 deletions(-) >> >> >> ## >> +# @BlockdevChangeReadOnlyMode: >> +# >> +# Specifies the new read-only mode of a block device subject to the >> +# @blockdev-change-medium command. >> +# >> +# @retain: Retains the current read-only mode >> +# >> +# @ro: Makes the device read-only >> +# >> +# @rw: Makes the device writable >> +# >> +# Since: 2.3 >> +## >> +{ 'enum': 'BlockdevChangeReadOnlyMode', >> + 'data': ['retain', 'ro', 'rw'] } > Bike-shedding; would 'read-only' and 'read-write' look any better than > abbreviations? Doesn't affect functionality, though. I don't mind either way. >> + >> + >> +## >> # @blockdev-change-medium: >> # >> # Changes the medium inserted into a block device by ejecting the current medium >> @@ -1799,12 +1817,16 @@ >> # @format: #optional, format to open the new image with (defaults to the >> # probed format) >> # >> +# @read-only: #optional, change the read-only mode of the device; defaults to >> +# 'retain' > "read-only":"rw" looks weird. Maybe naming this "read-mode" instead of > "read-only" would help. Again, bikeshedding that doesn't affect > functionality, but worth considering for the interface cleanliness. Well, actually it's write-mode, because reading will always be possible. :-) "access" would be another possibility, or "read-only-mode". > So functionally, if nothing changes, you can add: > Reviewed-by: Eric Blake > > But if you change the interface on a respin, drop my R-b to make sure I > check and still like the new naming conventions. Understood. Max