Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KOxwZ-0003xX-Gq for qemu-devel@nongnu.org; Fri, 01 Aug 2008 12:57:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KOxwX-0003xK-4t for qemu-devel@nongnu.org; Fri, 01 Aug 2008 12:57:30 -0400 Received: from [199.232.76.173] (port=54555 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KOxwW-0003xH-Ve for qemu-devel@nongnu.org; Fri, 01 Aug 2008 12:57:29 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:38521) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KOxwW-00088o-LC for qemu-devel@nongnu.org; Fri, 01 Aug 2008 12:57:28 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18579.16494.791024.25671@mariner.uk.xensource.com> Date: Fri, 1 Aug 2008 17:57:18 +0100 Subject: Re: [Qemu-devel] PATCH: v3 Allow control over drive file open mode In-Reply-To: <48932751.5040303@codemonkey.ws> References: <20080801102949.GN23993@redhat.com> <48932751.5040303@codemonkey.ws> From: Ian Jackson Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Anthony Liguori writes ("Re: [Qemu-devel] PATCH: v3 Allow control over drive file open mode"): > Allowing the user to specify what mode we use to open a file is IMHO not > a good interface for a user. A user should only be concerned with how > we expose a disk to the guest, not the underlying implementation of how > we support this. It has subtle side-effects that a user is not going to > expect unless they are intimately familiar with how QEMU is implemented > (like snapshotting breaking). I think I agree, but with qualifications: The user readonly flag ought to mean 1. qemu will definitely not permit the guest to write to the object represented (if it is a cow file then even the cow will not be writeable) 2. If the emulated device type supports it the guest will be told that it may not write to the device. If this is not possible and the user has not overridden this check then the entire request will be rejected (rather than exporting the device read/write). 3. qemu will to communicate the consequences for its future use of the underlying host operating system object(s) appropriately to the host system (as this might be relevant for cacheing, concurrent access, etc.) 4. qemu will take steps to try to ensure that bugs and missing changes in the readonly implementation don't leave a security hole where the 5. Operations (such as cow commit) that would modify data (either host data or data as seen by the guest or both) are not supported. I think 3 and 4 mean that it should pass O_RDONLY to the underlying filesystem objects where feasible. I'm afraid I don't understand your point about breaking snapshotting. Perhaps you could explain the scenario ? Ian.