From: Stefano Stabellini Subject: Re: libvirt, libxl and QDISKs Date: Fri, 26 Apr 2013 11:28:11 +0100 Message-ID: References: <5177EA93.7000403@eu.citrix.com> <1366880153.20256.432.camel@zakaz.uk.xensource.com> <1366889589.20256.510.camel@zakaz.uk.xensource.com> <1366891065.20256.517.camel@zakaz.uk.xensource.com> <51791DB1.9070903@eu.citrix.com> <1366893802.20256.526.camel@zakaz.uk.xensource.com> <51792E1F.3030005@eu.citrix.com> <1366898215.20256.552.camel@zakaz.uk.xensource.com> <5179D7F4.2080408@suse.com> <1366971237.3142.57.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1366971237.3142.57.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: George Dunlap , Jim Fehlig , xen-devel , Dave Scott , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Fri, 26 Apr 2013, Ian Campbell wrote: > On Fri, 2013-04-26 at 11:10 +0100, Stefano Stabellini wrote: > > On Fri, 26 Apr 2013, Jim Fehlig wrote: > > > if (l_disk->driverName) { > > > if (STREQ(l_disk->driverName, "tap") || > > > STREQ(l_disk->driverName, "tap2")) { > > > switch (l_disk->format) { > > > case VIR_STORAGE_FILE_QCOW: > > > x_disk->format = LIBXL_DISK_FORMAT_QCOW; > > > x_disk->backend = LIBXL_DISK_BACKEND_QDISK; > > > break; > > > case VIR_STORAGE_FILE_QCOW2: > > > x_disk->format = LIBXL_DISK_FORMAT_QCOW2; > > > x_disk->backend = LIBXL_DISK_BACKEND_QDISK; > > > break; > > > case VIR_STORAGE_FILE_VHD: > > > x_disk->format = LIBXL_DISK_FORMAT_VHD; > > > x_disk->backend = LIBXL_DISK_BACKEND_TAP; > > > break; > > > case VIR_STORAGE_FILE_NONE: > > > /* No subtype specified, default to raw/tap */ > > > case VIR_STORAGE_FILE_RAW: > > > x_disk->format = LIBXL_DISK_FORMAT_RAW; > > > x_disk->backend = LIBXL_DISK_BACKEND_TAP; > > > break; > > > default: > > > virReportError(VIR_ERR_INTERNAL_ERROR, > > > _("libxenlight does not support disk > > > driver %s"), > > > > > > virStorageFileFormatTypeToString(l_disk->format)); > > > return -1; > > > } > > > } else if (STREQ(l_disk->driverName, "file")) { > > > x_disk->format = LIBXL_DISK_FORMAT_RAW; > > > x_disk->backend = LIBXL_DISK_BACKEND_TAP; > > > } else if (STREQ(l_disk->driverName, "phy")) { > > > x_disk->format = LIBXL_DISK_FORMAT_RAW; > > > x_disk->backend = LIBXL_DISK_BACKEND_PHY; > > > } else { > > > virReportError(VIR_ERR_INTERNAL_ERROR, > > > _("libxenlight does not support disk driver %s"), > > > l_disk->driverName); > > > return -1; > > > } > > > } else { > > > /* > > > * If driverName is not specified, default to raw as per > > > * xl-disk-configuration.txt in the xen documentation and let > > > * libxl pick a suitable backend. > > > */ > > > x_disk->format = LIBXL_DISK_FORMAT_RAW; > > > x_disk->backend = LIBXL_DISK_BACKEND_UNKNOWN; > > > } > > > > It looks like the defaults are the same of libxl. > > > > However the mapping of RAW to TAP (libxl does the same) has always been > > a bit dubious to me: now that upstream QEMU is used with HVM guests too > > by libxl, there is no reason to use blktap over QEMU for raw files any > > more. > > There are two TAP+RAW in the above, one is inside an if (driver="tap") > which seems reasonable, are you talking about the one in the > driver="file"? Yes > I think it would be better for libvirt in the file and phy cases to just > say format=raw and leave libxl to pick a backend capable of providing > this. I agree > Changing what libxl does is a separate question, but I think you are > right that a case could be made for preferring qdisk in the default > case. Indeed