Skip to contentSkip to conversation

libxl: detect support for save and restore

PATCH Eric Blake 3 participants 3 messages Jun 26, 2014 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Eric Blake

author
#1 lore raw
Quoted 15 lines · Jim Fehlig

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 <migration_features>.

Found by Ian Campbell while improving Xen's OSSTEST infrastructure

http://lists.xen.org/archives/html/xen-devel/2014-06/msg02171.html

---

Another option for

https://www.redhat.com/archives/libvir-list/2014-June/msg01276.html

Quoted 8 lines

With this one, we even avoid the distasteful double negative :).

Compile-tested on x86 only at this point. The ARM build is still slowly grinding away...

 src/libxl/libxl_conf.c   |  4 ++++
 src/libxl/libxl_driver.c | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+)

Looks better; thanks for putting up with me :)

ACK if it passes your testing

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
In reply to a message not in the archive
Quoted 11 lines · Jim Fehlig

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 <migration_features>.

Found by Ian Campbell while improving Xen's OSSTEST infrastructure

http://lists.xen.org/archives/html/xen-devel/2014-06/msg02171.html

---

Quoted 8 lines

Another option for

https://www.redhat.com/archives/libvir-list/2014-June/msg01276.html

With this one, we even avoid the distasteful double negative :).

Compile-tested on x86 only at this point. The ARM build is still slowly grinding away...

Build and runtime tested on ARM and x86 here, works fine. Thanks!

Ian.

Quoted 109 lines
 src/libxl/libxl_conf.c   |  4 ++++
 src/libxl/libxl_driver.c | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+)
src/libxl/libxl_conf.c +4 -0
index 4b6b5c0..8eeaf82 100644
@@ -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)
src/libxl/libxl_driver.c +35 -0
index 1ea99e2..646c9b9 100644
@@ -1379,6 +1379,11 @@ libxlDomainSaveFlags(virDomainPtr dom, const char *to, const char *dxml,
     int ret = -1;
     bool remove_dom = false;
 
+#ifdef LIBXL_HAVE_NO_SUSPEND_RESUME
+    virReportUnsupportedError();
+    return -1;
+#endif
+
     virCheckFlags(0, -1);
     if (dxml) {
         virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
@@ -1440,6 +1445,11 @@ libxlDomainRestoreFlags(virConnectPtr conn, const char *from,
     int fd = -1;
     int ret = -1;
 
+#ifdef LIBXL_HAVE_NO_SUSPEND_RESUME
+    virReportUnsupportedError();
+    return -1;
+#endif
+
     virCheckFlags(VIR_DOMAIN_SAVE_PAUSED, -1);
     if (dxml) {
         virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
@@ -4351,6 +4361,11 @@ libxlDomainMigrateBegin3Params(virDomainPtr domain,
     const char *xmlin = NULL;
     virDomainObjPtr vm = NULL;
 
+#ifdef LIBXL_HAVE_NO_SUSPEND_RESUME
+    virReportUnsupportedError();
+    return NULL;
+#endif
+
     virCheckFlags(LIBXL_MIGRATION_FLAGS, NULL);
     if (virTypedParamsValidate(params, nparams, LIBXL_MIGRATION_PARAMETERS) < 0)
         return NULL;
@@ -4395,6 +4410,11 @@ libxlDomainMigratePrepare3Params(virConnectPtr dconn,
     const char *dname = NULL;
     const char *uri_in = NULL;
 
+#ifdef LIBXL_HAVE_NO_SUSPEND_RESUME
+    virReportUnsupportedError();
+    return -1;
+#endif
+
     virCheckFlags(LIBXL_MIGRATION_FLAGS, -1);
     if (virTypedParamsValidate(params, nparams, LIBXL_MIGRATION_PARAMETERS) < 0)
         goto error;
@@ -4445,6 +4465,11 @@ libxlDomainMigratePerform3Params(virDomainPtr dom,
     const char *uri = NULL;
     int ret = -1;
 
+#ifdef LIBXL_HAVE_NO_SUSPEND_RESUME
+    virReportUnsupportedError();
+    return -1;
+#endif
+
     virCheckFlags(LIBXL_MIGRATION_FLAGS, -1);
     if (virTypedParamsValidate(params, nparams, LIBXL_MIGRATION_PARAMETERS) < 0)
         goto cleanup;
@@ -4497,6 +4522,11 @@ libxlDomainMigrateFinish3Params(virConnectPtr dconn,
     virDomainObjPtr vm = NULL;
     const char *dname = NULL;
 
+#ifdef LIBXL_HAVE_NO_SUSPEND_RESUME
+    virReportUnsupportedError();
+    return NULL;
+#endif
+
     virCheckFlags(LIBXL_MIGRATION_FLAGS, NULL);
     if (virTypedParamsValidate(params, nparams, LIBXL_MIGRATION_PARAMETERS) < 0)
         return NULL;
@@ -4545,6 +4575,11 @@ libxlDomainMigrateConfirm3Params(virDomainPtr domain,
     libxlDriverPrivatePtr driver = domain->conn->privateData;
     virDomainObjPtr vm = NULL;
 
+#ifdef LIBXL_HAVE_NO_SUSPEND_RESUME
+    virReportUnsupportedError();
+    return -1;
+#endif
+
     virCheckFlags(LIBXL_MIGRATION_FLAGS, -1);
     if (virTypedParamsValidate(params, nparams, LIBXL_MIGRATION_PARAMETERS) < 0)
         return -1;

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 22 lines · Eric Blake
Quoted 20 lines · Jim Fehlig

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 <migration_features>.

Found by Ian Campbell while improving Xen's OSSTEST infrastructure

http://lists.xen.org/archives/html/xen-devel/2014-06/msg02171.html

---

Another option for

https://www.redhat.com/archives/libvir-list/2014-June/msg01276.html

With this one, we even avoid the distasteful double negative :).

Compile-tested on x86 only at this point. The ARM build is still slowly grinding away...

Quoted 9 lines
Quoted 4 lines
 src/libxl/libxl_conf.c   |  4 ++++
 src/libxl/libxl_driver.c | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+)

Looks better; thanks for putting up with me :)

ACK if it passes your testing

Ian provided the passing test results. I've pushed this now. Thanks!

Regards,
Jim