Received: from eggs.gnu.org ([2001:4830:134:3::10]:37988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xvs6K-0002HM-Uh for qemu-devel@nongnu.org; Tue, 02 Dec 2014 13:23:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xvs6A-0002Sn-4G for qemu-devel@nongnu.org; Tue, 02 Dec 2014 13:23:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48201) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xvs69-0002SJ-TW for qemu-devel@nongnu.org; Tue, 02 Dec 2014 13:22:54 -0500 From: Markus Armbruster References: <1416487488-8423-1-git-send-email-mreitz@redhat.com> <20141126161748.GH3548@noname.str.redhat.com> <877fyf1gbu.fsf@blackfin.pond.sub.org> <547D8356.1090106@redhat.com> Date: Tue, 02 Dec 2014 19:22:42 +0100 In-Reply-To: <547D8356.1090106@redhat.com> (Max Reitz's message of "Tue, 02 Dec 2014 10:16:06 +0100") Message-ID: <87sigxlxn1.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain 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: Kevin Wolf , Peter Lieven , qemu-devel@nongnu.org, Stefan Hajnoczi , Luiz Capitulino Max Reitz writes: > On 2014-11-28 at 16:43, Markus Armbruster wrote: >> Kevin Wolf writes: >> >>> 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. >> QMP eschews magic. I'd prefer to keep 'auto' out. >> >> HMP can offer it regardless, if it's useful. But I doubt it will be. >> Few users will need to control this, and fewer will realize they can by >> giving an extra argument. > > Well, Kevin made the good point of the user generally knowing whether > a file should be written to or not. Furthermore, I don't think it > would be too hard to use rw, then see that access was denied, and then > use ro, manually. Maybe that's even better than auto, somehow. Please give it a try.