From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MGcsA-0003hj-3k for qemu-devel@nongnu.org; Tue, 16 Jun 2009 13:55:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MGcs5-0003co-6A for qemu-devel@nongnu.org; Tue, 16 Jun 2009 13:55:01 -0400 Received: from [199.232.76.173] (port=58564 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGcs4-0003cf-VE for qemu-devel@nongnu.org; Tue, 16 Jun 2009 13:54:57 -0400 Received: from mx2.redhat.com ([66.187.237.31]:57424) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MGcs4-0002AF-CP for qemu-devel@nongnu.org; Tue, 16 Jun 2009 13:54:56 -0400 Message-ID: <4A37DC64.4090501@redhat.com> Date: Tue, 16 Jun 2009 20:54:44 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] Regression opening read-only cdroms References: <4A37896C.8050208@redhat.com> <20090616143259.GA29040@shareable.org> <4A37B23F.6040604@eu.citrix.com> <20090616145421.GD29040@shareable.org> <4A37C82B.5030805@codemonkey.ws> <4A37D30D.40003@eu.citrix.com> <20090616174653.GA11893@shareable.org> In-Reply-To: <20090616174653.GA11893@shareable.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jamie Lokier Cc: Christoph Hellwig , qemu-devel , Stefano Stabellini On 06/16/2009 08:46 PM, Jamie Lokier wrote: >>> It only is useful if we can expose that read-only attribute to the >>> guest. You can't do that consistently with all block devices so the >>> result would be that you'll fail write operations causing a guest to crash. >>> > > You should get disk write errors, rather than a simple crash. Any > decent operating system will spew a lot of printks, which is a clue. > I don't consider this useful behaviour and see no motivation to support it. > Users who expect things to just work will be even more surprised that > "-hda image" where image is read-only does not give any error from > QEMU, but their guest crashes. Or that "-hda image" works as usual, > and their guest crashes, and eventually they discover it's because > their disk image is not writable, and it's always worked before > because they were using -snapshot or something like that, and QEMU > didn't warn them it would be a problem... > I agree, for non-cdroms/floppies, non-backing store files we should require write access. > It is also appropriate for disks that you intent to always mount > read-only in the guest anyway, even if the interface doesn't have a > flag, just to protect the image from aberrant guest behaviour. > Maybe -drive ...,snapshot. The disk will be writable, just not persistent. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.