From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MGZzv-0006l2-CB for qemu-devel@nongnu.org; Tue, 16 Jun 2009 10:50:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MGZzq-0006kn-UU for qemu-devel@nongnu.org; Tue, 16 Jun 2009 10:50:50 -0400 Received: from [199.232.76.173] (port=48752 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGZzq-0006kk-Oj for qemu-devel@nongnu.org; Tue, 16 Jun 2009 10:50:46 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:17534) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MGZzq-0004Rn-AS for qemu-devel@nongnu.org; Tue, 16 Jun 2009 10:50:46 -0400 Message-ID: <4A37B23F.6040604@eu.citrix.com> Date: Tue, 16 Jun 2009 15:54:55 +0100 From: Stefano Stabellini MIME-Version: 1.0 Subject: Re: [Qemu-devel] Regression opening read-only cdroms References: <4A37896C.8050208@redhat.com> <20090616143259.GA29040@shareable.org> In-Reply-To: <20090616143259.GA29040@shareable.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jamie Lokier Cc: qemu-devel , Avi Kivity , Christoph Hellwig 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. Indeed. I have a patch that adds bdrv_set_read_only that set bs->read_only = 1 so that bdrv_open2 can check if the flag is set and act accordingly. The problem is that in xen we read whether the device should be opened read only in the VM config file, I don't think the user can specify to open a drive read-only in qemu. > 2. Would it make sense to open CD-ROM images read-only all the time, > when they are opened with media=cdrom, or can QEMU's CD-ROM devices > write to the images? > not at the moment, it may be possible in the future.