From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Fehlig Subject: Re: [PATCH RFC OSSTEST 7/9] Toolstack: Abstract away migration support check. Date: Tue, 24 Jun 2014 21:18:33 -0600 Message-ID: <53AA3F89.6050904__26600.4087673084$1403666468$gmane$org@suse.com> References: <1403018758.25074.5.camel@kazak.uk.xensource.com> <1403018809-25509-7-git-send-email-ian.campbell@citrix.com> <1403019217.25074.10.camel@kazak.uk.xensource.com> <53A89C03.7030002@suse.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090306050606030407040009" Return-path: In-Reply-To: <53A89C03.7030002@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: Ian Campbell Cc: LibVir , ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------090306050606030407040009 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Jim Fehlig wrote: > Ian Campbell wrote: > >> Jim, >> >> What would be the right thing to do for this? The intention is for >> osstest to skip migration tests when that feature is unimplemented by >> the toolstack/xen/arch combination. >> >> It looks like the output of "virsh capabilities" indicates migration: >> >> >> >> tcp >> >> >> is that the right place to look? >> >> > > Yes. > > >> Will this capability be automagically suppressed on ARM until we >> implement it? >> > > Unfortunately, no :-/. Currently, the libvirt libxl driver will include > and call save, restore, and migrate regardless of arch. > > >> FYI xl uses LIBXL_HAVE_NO_SUSPEND_RESUME to figure this >> out... >> >> > > Ah, interesting. Thanks for the tip. I'll need to add similar logic in > the libxl driver. > Something like the attached patch (compile-tested only). You'll need an updated libvirt.git master to apply cleanly. Regards, Jim --------------090306050606030407040009 Content-Type: text/x-patch; name="libxl-detect-save-restore.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="libxl-detect-save-restore.patch" >>From 5c805d24d7d78c4435b871ffaf938c3e302c7a6f Mon Sep 17 00:00:00 2001 From: Jim Fehlig Date: Tue, 24 Jun 2014 11:10:49 -0600 Subject: [PATCH] libxl: detect support for save and restore libxl does not support save, restore, or migrate on all architectures, notably ARM. Detect whether libxl supports these operations using LIBXL_HAVE_NO_SUSPEND_RESUME. If not supported, drop advertisement of . Signed-off-by: Jim Fehlig --- src/libxl/libxl_conf.c | 4 ++++ src/libxl/libxl_driver.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 4b6b5c0..8eeaf82 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -1340,7 +1340,11 @@ libxlMakeCapabilities(libxl_ctx *ctx) { virCapsPtr caps; +#ifdef LIBXL_HAVE_NO_SUSPEND_RESUME + if ((caps = virCapabilitiesNew(virArchFromHost(), 0, 0)) == NULL) +#else if ((caps = virCapabilitiesNew(virArchFromHost(), 1, 1)) == NULL) +#endif return NULL; if (libxlCapsInitHost(ctx, caps) < 0) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 1ea99e2..f90bf64 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -1370,6 +1370,7 @@ libxlDoDomainSave(libxlDriverPrivatePtr driver, virDomainObjPtr vm, return ret; } +#ifndef LIBXL_HAVE_NO_SUSPEND_RESUME static int libxlDomainSaveFlags(virDomainPtr dom, const char *to, const char *dxml, unsigned int flags) @@ -1488,6 +1489,7 @@ libxlDomainRestore(virConnectPtr conn, const char *from) { return libxlDomainRestoreFlags(conn, from, NULL, 0); } +#endif /* ifndef LIBXL_HAVE_NO_SUSPEND_RESUME */ static int libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags) @@ -4594,10 +4596,12 @@ static virDriver libxlDriver = { .domainSetMemoryFlags = libxlDomainSetMemoryFlags, /* 0.9.0 */ .domainGetInfo = libxlDomainGetInfo, /* 0.9.0 */ .domainGetState = libxlDomainGetState, /* 0.9.2 */ +#ifndef LIBXL_HAVE_NO_SUSPEND_RESUME .domainSave = libxlDomainSave, /* 0.9.2 */ .domainSaveFlags = libxlDomainSaveFlags, /* 0.9.4 */ .domainRestore = libxlDomainRestore, /* 0.9.2 */ .domainRestoreFlags = libxlDomainRestoreFlags, /* 0.9.4 */ +#endif .domainCoreDump = libxlDomainCoreDump, /* 0.9.2 */ .domainSetVcpus = libxlDomainSetVcpus, /* 0.9.0 */ .domainSetVcpusFlags = libxlDomainSetVcpusFlags, /* 0.9.0 */ @@ -4650,11 +4654,13 @@ static virDriver libxlDriver = { .nodeDeviceDetachFlags = libxlNodeDeviceDetachFlags, /* 1.2.3 */ .nodeDeviceReAttach = libxlNodeDeviceReAttach, /* 1.2.3 */ .nodeDeviceReset = libxlNodeDeviceReset, /* 1.2.3 */ +#ifndef LIBXL_HAVE_NO_SUSPEND_RESUME .domainMigrateBegin3Params = libxlDomainMigrateBegin3Params, /* 1.2.6 */ .domainMigratePrepare3Params = libxlDomainMigratePrepare3Params, /* 1.2.6 */ .domainMigratePerform3Params = libxlDomainMigratePerform3Params, /* 1.2.6 */ .domainMigrateFinish3Params = libxlDomainMigrateFinish3Params, /* 1.2.6 */ .domainMigrateConfirm3Params = libxlDomainMigrateConfirm3Params, /* 1.2.6 */ +#endif }; static virStateDriver libxlStateDriver = { -- 1.8.4.5 --------------090306050606030407040009 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 --------------090306050606030407040009--