From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtfI4-0008In-5p for qemu-devel@nongnu.org; Wed, 26 Nov 2014 11:18:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XtfHy-0007rP-12 for qemu-devel@nongnu.org; Wed, 26 Nov 2014 11:18:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40577) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtfHx-0007rB-Qe for qemu-devel@nongnu.org; Wed, 26 Nov 2014 11:17:57 -0500 Date: Wed, 26 Nov 2014 17:17:48 +0100 From: Kevin Wolf Message-ID: <20141126161748.GH3548@noname.str.redhat.com> References: <1416487488-8423-1-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1416487488-8423-1-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH 0/3] blockdev: Add read-only option to change-blockdev List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Markus Armbruster , Peter Lieven , qemu-devel@nongnu.org, Luiz Capitulino , Stefan Hajnoczi Am 20.11.2014 um 13:44 hat Max Reitz geschrieben: > The 'change' QMP and HMP command allows replacing the medium in drives > which support this, e.g. floppy disk drives. For some drives, the medium > carries information about whether it can be written to or not (again, > floppy drives). Therefore, it should be possible to change the read-only > state of block devices when changing the loaded medium. > > This series adds an optional additional parameter to the 'change' QMP > and HMP command which allows changing the read-only state in four ways: > > - '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 > - 'auto': This opens the new file R/W first, if that fails, the file is > opened read-only. Not sure if 'auto' is worth implementing (it's a typical HMP default action that no QMP client would use, except that it isn't even the default for HMP), but the implementation looks correct at least. Reviewed-by: Kevin Wolf