From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MGazm-0006h4-QT for qemu-devel@nongnu.org; Tue, 16 Jun 2009 11:54:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MGazi-0006f7-7W for qemu-devel@nongnu.org; Tue, 16 Jun 2009 11:54:46 -0400 Received: from [199.232.76.173] (port=40963 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGazh-0006f2-VD for qemu-devel@nongnu.org; Tue, 16 Jun 2009 11:54:42 -0400 Received: from mail2.shareable.org ([80.68.89.115]:51458) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MGazh-0006NS-LR for qemu-devel@nongnu.org; Tue, 16 Jun 2009 11:54:41 -0400 Date: Tue, 16 Jun 2009 16:54:38 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] Regression opening read-only cdroms Message-ID: <20090616155438.GL29040@shareable.org> References: <4A37896C.8050208@redhat.com> <20090616143259.GA29040@shareable.org> <4A37B756.6090008@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A37B756.6090008@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Christoph Hellwig , qemu-devel Avi Kivity wrote: > On 06/16/2009 05:33 PM, Jamie Lokier wrote: > >Avi Kivity wrote: > > > >>qemu used to be quite happy opening read-only cdrom images, and I was > >>quite happy feeding kvm-autotest a library of read-only iso images. > >> > > > >1. While we're here, an _option_ to open an image read-only even when > > you have write permission would be useful, for those occasions when > > you want to boot from some valuable image and be certain you aren't > > modifying it - without having to chmod back and forth in > > Qemu-wrapper scripts, or copy the image first. > > > > read-only disk images don't make much sense. And yet "chmod 444 image; qemu ..." works. If you're booting from a disk you don't need to write to, obviously. Generally it'll need to be mounted read-only in the guest. > Using -snapshot will generally ensure the image is not modified, while > allowing the guest to write. I never do that with _valuable_ images because: - Valuable images are expensive/difficult/impossible to recreate. But too large to copy about casually. - I don't have that much faith in QEMU's correctness, having already been bitten by a number it's bugs, or in the guest's correctness if I were to rely on the guest doing read-only mount instead of using -snapshot. - It's too easy to accidentally write back the changes over the the original image. Man page: "the raw disk image you use is not written back. You can however force the write back by pressing C-a s". And I don't do it when booting a guest where I have _both_ a disk a do want to write, and another valuable image that I don't want written, because: - How would I use -snapshot and then commit changes to the disk I do want to write (either C-a s or "commit" in the monitor), but never write changes to the disk I don't want written? - "commit" has always been a bit ambiguous when applied to a combination of -snapshot and a qcow2 delta image. Finally, QEMU clearly does support read-only images, so it's always struck me as odd that the only way to invoke this support is using "chmod" outside QEMU. (Actually I use "chattr +i" as well. That's how paranoid I am about difficult to recreate images). -- Jamie