Received: from eggs.gnu.org ([208.118.235.92]:36472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwnpP-0006pj-5i for qemu-devel@nongnu.org; Thu, 02 Aug 2012 01:20:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwnpN-00023I-JR for qemu-devel@nongnu.org; Thu, 02 Aug 2012 01:20:06 -0400 Received: from ipmail07.adl2.internode.on.net ([150.101.137.131]:21865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwnpN-0001wZ-6y for qemu-devel@nongnu.org; Thu, 02 Aug 2012 01:20:05 -0400 Date: Thu, 2 Aug 2012 14:49:52 +0930 From: Kevin Shanahan Message-ID: <20120802051952.GC18298@tuon.disenchant.local> References: <20120802013242.GA18298@tuon.disenchant.local> <20120802021613.GB18298@tuon.disenchant.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120802021613.GB18298@tuon.disenchant.local> Subject: Re: [Qemu-devel] [PATCH] block: Set cdrom device read only flag List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: libvir-list@redhat.com, Kevin Wolf On Thu, Aug 02, 2012 at 11:46:13AM +0930, Kevin Shanahan wrote: > On Thu, Aug 02, 2012 at 11:02:42AM +0930, Kevin Shanahan wrote: > > Set the block driver read_only flag for cdrom devices so that > > qmp_change_blockdev does not attempt to open cdrom files in read-write > > mode when changing media. > > Hrm, this fixes my simple test case using the kvm monitor directly but > changing media via libvirt still has the same issue (fails for RO > files, succeeds for writable files). > > $ virsh attach-disk --type cdrom --mode readonly test1 /srv/kvm/iso/ubuntu-12.04-server-amd64.iso hdc > error: Failed to attach disk > error: internal error unable to execute QEMU command 'change': Could not open '/srv/kvm/iso/ubuntu-12.04-server-amd64.iso' > > I'll keep looking into it. In the libvirt case, it seems libvirt is failing to add media=cdrom to the commandline, so in this case qemu is defaulting to media=disk and my proposed fix has no effect. Diving into libvirt now to see why no media=disk is getting added... Common test case has this xml (generated by virt-install):
> Cheers, > Kevin.