From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Scott Subject: Re: libvirt, libxl and QDISKs Date: Fri, 26 Apr 2013 11:37:06 +0100 Message-ID: <517A58D2.6090205@eu.citrix.com> 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> <517A079B.60503@suse.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020305010207010808020004" Return-path: In-Reply-To: <517A079B.60503@suse.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: Jim Fehlig Cc: George Dunlap , Stefano Stabellini , Ian Campbell , xen-devel List-Id: xen-devel@lists.xenproject.org --------------020305010207010808020004 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit On 26/04/13 05:50, Jim Fehlig wrote: > Jim Fehlig wrote: >> Ian Campbell wrote: >> >>> On Thu, 2013-04-25 at 14:22 +0100, Dave Scott wrote: >>> >>> >>>> On 25/04/13 13:43, Ian Campbell wrote: >>>> >>>> >>> >>> >>>> It looks like we could define a "qdisk" driverName. >>>> >>>> >>> Yes, I think this would work. WRT to your comment below it looks like >>> other libvirt drivers call this driver "qemu". >>> >>> >> >> IMO, we should just extend the above to map driverName 'qemu' to backend >> 'qdisk'. But what about the formats? I though qdisk could handle all >> of them, particularly with qemu-upstream, even vmdk? >> > > Something like the attached, which seems to work well for me when > specifying driverName = qemu, e.g. > > > > > > This also works for me! On a related note, what do you think about the attached patch? It allows the user to select a non-default qemu via the element. My domain XML looked like this: /usr/lib/xen/bin/qemu-system-i386 Now that upstream qemu is the default in xen-4.3, it seems useful to be able to select the traditional qemu for older VMs. Also I backported this to my xen-4.2 system and used this patch + your patch + the previous 'stat()' fix to successfully start a VM on ceph storage via libvirt + libxl (my quest is almost complete!) Cheers, Dave --------------020305010207010808020004 Content-Type: text/x-patch; name="libxl-make-emulator.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="libxl-make-emulator.patch" diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index f549a5d..abbd3c0 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -811,6 +811,30 @@ libxlMakeCapabilities(libxl_ctx *ctx) } int +libxlMakeEmulator(virDomainDefPtr def, libxl_domain_config *d_config) +{ + /* No explicit override means use the default */ + if (!def->emulator) { + return 0; + } + if (strstr(def->emulator, "/qemu-system-")) { + d_config->b_info.device_model_version = + LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN; + return 0; + } + if (strstr(def->emulator, "/qemu-dm")) { + d_config->b_info.device_model_version = + LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL; + return 0; + } + virReportError(VIR_ERR_INTERNAL_ERROR, + _("libxenlight doesn't support emulator '%s'"), + def->emulator); + return -1; +} + + +int libxlBuildDomainConfig(libxlDriverPrivatePtr driver, virDomainDefPtr def, libxl_domain_config *d_config) { @@ -834,6 +858,10 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver, goto error; } + if (libxlMakeEmulator(def, d_config) < 0) { + goto error; + } + d_config->on_reboot = def->onReboot; d_config->on_poweroff = def->onPoweroff; d_config->on_crash = def->onCrash; --------------020305010207010808020004 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --------------020305010207010808020004--