Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSZu2-00066S-Ey for qemu-devel@nongnu.org; Mon, 11 Aug 2008 12:05:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSZu0-00063r-GF for qemu-devel@nongnu.org; Mon, 11 Aug 2008 12:05:49 -0400 Received: from [199.232.76.173] (port=56359 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSZu0-00063X-9m for qemu-devel@nongnu.org; Mon, 11 Aug 2008 12:05:48 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:1223) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KSZtz-00043L-W1 for qemu-devel@nongnu.org; Mon, 11 Aug 2008 12:05:48 -0400 Received: from mariner.uk.xensource.com ([10.80.2.22]) by smtp01.ad.xensource.com (8.13.1/8.13.1) with ESMTP id m7BG5YJK009374 for ; Mon, 11 Aug 2008 09:05:40 -0700 Received: from iwj by mariner.uk.xensource.com with local (Exim 4.63) (envelope-from ) id 1KSZtm-00006i-8W for qemu-devel@nongnu.org; Mon, 11 Aug 2008 17:05:34 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18592.25422.257378.988970@mariner.uk.xensource.com> Date: Mon, 11 Aug 2008 17:05:34 +0100 Subject: Re: [Qemu-devel] PATCH: v3 Allow control over drive file open mode In-Reply-To: <4893448C.1050508@codemonkey.ws> References: <20080801102949.GN23993@redhat.com> <48932751.5040303@codemonkey.ws> <18579.16494.791024.25671@mariner.uk.xensource.com> <4893448C.1050508@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"): > Ian Jackson wrote: > > 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 > > I'm not at all worried about this FWIW. Well, in the Xen world we have different priorities I think. Many people are depending very heavily on the security properties of Xen including the hardware emulations. So for us it is important that we take all the measures we can to stop us from accidentally committing bugs. If this is something that qemu upstream doesn't want then we will have to maintain it as a permanent delta in our `Xen' tree (along with the mapcache, etc. etc.) It would be fine if there were in fact only one place where writes take place. But actually there are multiple routes at pretty much all levels: multiple entrypoints (aio and not, pwrite or not), multiple block drivers, in cow devices multiple read/write paths depending on whether the block is already present in the diffs and multiple writes to the .img for each requested write, etc. > qemu-system-x86_64 -drive file=foo.img -drive file=boo.img,read-only=on > > Down the road, you do a savevm. savevm has to create a checkpoint in > all disk images. The checkpoint will be empty in boo.img but it still > needs to create one. Perhaps I don't understand clearly enough how you imagine this scenario. Surely when the snapshot is resumed it is sufficient for the file boo.img to be identical ? What are these checkpoints ? Are they currently written by anything ? I've tried to look for the code you would be referring to but I can't seem to find it. qemu_savevm_state just calls all the things recorded with register_savevm and I can't seem to find anything that would do anything to block drivers. Of course there are many things in hw/*.c that call register_savevm. I looked in hw/ide.c too and it just saves the state of the driver, and seems content to assume that the contents (as seen through qemu's block driver abstract interface) of the block device will be identical because nothing will change it between save and restore. If the file is opened read-only then qemu won't change it. Are you imagining a scenario where the cow img file would be modified by some external process between save and restore ? Surely that would be a broken thing to do. Or do you mean that the intent is to cope with the backing file changing between save and restore and that therefore the whole backing file will be copied into the .img ? I'm afraid as you can see I'm still confused. Ian.