From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXdza-0000mO-Om for qemu-devel@nongnu.org; Wed, 20 Jan 2010 12:05:18 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXdzW-0000fw-5H for qemu-devel@nongnu.org; Wed, 20 Jan 2010 12:05:18 -0500 Received: from [199.232.76.173] (port=58311 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXdzV-0000fj-Rw for qemu-devel@nongnu.org; Wed, 20 Jan 2010 12:05:13 -0500 Received: from verein.lst.de ([213.95.11.210]:51561) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1NXdzV-0007QU-7l for qemu-devel@nongnu.org; Wed, 20 Jan 2010 12:05:13 -0500 Date: Wed, 20 Jan 2010 18:05:10 +0100 From: Christoph Hellwig Subject: Re: [Qemu-devel] [PATCH v2 0/4] Modifications to the drives' readonly attribute Message-ID: <20100120170510.GA8444@lst.de> References: <1263739695-13043-1-git-send-email-nsprei@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1263739695-13043-1-git-send-email-nsprei@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Naphtali Sprei Cc: qemu-devel@nongnu.org Looking at the version of this that landed in git I don't think the read-only handling is entirely clean after this. - 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 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 o vvfat as usual is a complete mess setting and clearing it in various places - in addition to that bdrv_open2 also sets it after calling itself for the backing hd which seems superflous - there also is a now unused bdrv_set_read_only helper to set it from outside block.c