From: Ian Jackson Subject: Re: [PATCH v2 for-4.6] libxl: handle read-only drives with qemu-xen Date: Tue, 15 Sep 2015 17:22:41 +0100 Message-ID: <22008.17873.704727.417727@mariner.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zbt0I-0003mp-SB for xen-devel@lists.xenproject.org; Tue, 15 Sep 2015 16:22:46 +0000 In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: Ian.Campbell@eu.citrix.com, xen-devel@lists.xenproject.org, wei.liu2@citrix.com, m.a.young@durham.ac.uk List-Id: xen-devel@lists.xenproject.org Stefano Stabellini writes ("[PATCH v2 for-4.6] libxl: handle read-only drives with qemu-xen"): > The current libxl code doesn't deal with read-only drives at all. > > Upstream QEMU and qemu-xen only support read-only cdrom drives: make > sure to specify "readonly=on" for cdrom drives and return error in case > the user requested a non-cdrom read-only drive. Acked-by: Ian Jackson I have determined by experiment that cdroms are always marked readonly. My qemu-dm opened a test iso, which I had expressed to be passed as a cdrom, readonly. So maybe the guest would be able to get qemu to write to it, but this would just result in errors (or maybe a crash somewhere in qemu). I was not able to easily persuade Linux to write to the cdrom device. > - (gc, "if=ide,index=%d,media=cdrom,cache=writeback,id=ide-%i", > - disk, dev_number); > + (gc, "if=ide,index=%d,readonly=%s,media=cdrom,cache=writeback,id=ide-%i", > + disk, disks[i].readwrite ? "off" : "on", dev_number); I don't know what the effect of this would be on qemu iff readwrite==0. I think it might be ineffective. But that is certainly not a security problem. I have just sent a draft of the advisory. Ian.