From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MxMdp-0003Dw-Je for qemu-devel@nongnu.org; Mon, 12 Oct 2009 11:16:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MxMdl-00039Y-SI for qemu-devel@nongnu.org; Mon, 12 Oct 2009 11:16:53 -0400 Received: from [199.232.76.173] (port=38646 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MxMdl-00039E-Jb for qemu-devel@nongnu.org; Mon, 12 Oct 2009 11:16:49 -0400 Received: from mail2.shareable.org ([80.68.89.115]:36244) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MxMdl-0006Gi-7B for qemu-devel@nongnu.org; Mon, 12 Oct 2009 11:16:49 -0400 Date: Mon, 12 Oct 2009 16:16:44 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] [PATCH] Add readonly flag to -drive command Message-ID: <20091012151644.GE13560@shareable.org> References: <4AD32550.8040901@redhat.com> <4AD32DF6.4050100@redhat.com> <20091012135032.GA13560@shareable.org> <4AD33D6D.9020900@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AD33D6D.9020900@codemonkey.ws> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Kevin Wolf , Naphtali Sprei , qemu-devel@nongnu.org Anthony Liguori wrote: > Jamie Lokier wrote: > >Kevin Wolf wrote: > > > >>Am 12.10.2009 14:47, schrieb Naphtali Sprei: > >> > >>>In order to safely share an image between guests (as read only drive), > >>>add a 'readonly' flag > >>>to the -drive command (qemu command line and monitor). > >>> > > > >Heh. I've been sharing images between guests for ages - using "chmod -r" > >:-) > > > > Were it not for backwards compatibility, I would remove that and have it > error out. > > I've had multiple people end up with strangely broken guests because > they didn't realize the image was read only. I agree, that's ugly - I've wasted time on a strangely broken guest in that situation too! Backward compatibility might be an issue with the idea to change QEMU to complain if it can't open a file writable. Not with regular disk images so much, but floppy/USB images. Perhaps the answer to that is 'readonly=auto', 'readonly=yes', 'readonly=no'? Sharing images with -snapshot, and backing images with qcow2, is a very useful feature for launching multiple test VMs in parallel, and for making "forked" images for testing different guest OS variations, so I'm glad to see the 'readonly' flag appearing as an option. (You can't use qcow2 snapshots to implement "forked" images running in parallel because you can't safely open different snapshots in the same qcow2 file at the same time). Taking a read-only (shared) or writeable (exclusive) lock on the file would be a useful addition I think, to catch mistakes. -- Jamie