From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXwwr-000898-AV for qemu-devel@nongnu.org; Thu, 21 Jan 2010 08:19:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXwwm-000857-KX for qemu-devel@nongnu.org; Thu, 21 Jan 2010 08:19:44 -0500 Received: from [199.232.76.173] (port=43575 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXwwm-00084x-Ac for qemu-devel@nongnu.org; Thu, 21 Jan 2010 08:19:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2319) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXwwl-0000Bz-U8 for qemu-devel@nongnu.org; Thu, 21 Jan 2010 08:19:40 -0500 Message-ID: <4B585460.4070901@redhat.com> Date: Thu, 21 Jan 2010 15:19:28 +0200 From: Naphtali Sprei MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v2 0/4] Modifications to the drives' readonly attribute References: <1263739695-13043-1-git-send-email-nsprei@redhat.com> <20100120170510.GA8444@lst.de> In-Reply-To: <20100120170510.GA8444@lst.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: qemu-devel@nongnu.org Christoph Hellwig wrote: > Looking at the version of this that landed in git I don't think the > read-only handling is entirely clean after this. I fixed what I could, still I got some questions below. > > - we now normally set the read_only flag from bdrv_open2 when we do > not have the O_RDWR flag set > - but the block drivers also mess with it: > o raw-posix superflously sets it when BDRV_O_RDWR is not in the > open flags Not sure where exactly is the issue. Can you please point the line ? > o bochs, cloop, dmg and parallels set it unconditionally given > that they do not support writing at all. But they do not > bother to reject opens without BDRV_O_RDWR I just changed bochs and parallels not to ask for read-write. Should all of them test the flags for RDWR and returns failure ? > o vvfat as usual is a complete mess setting and clearing it in > various places Fixed one occurance. More places ? > - in addition to that bdrv_open2 also sets it after calling itself for > the backing hd which seems superflous Is this a problem ? I thought it's safer to mark it read-only, in case a write operation requested somehow. > - there also is a now unused bdrv_set_read_only helper to set it from > outside block.c Done. Removed. > > Thanks, Naphtali