Skip to contentSkip to conversation

libxl: switch to using libxl_domain_create_restore from v4.4 API

PATCH New Jim Fehlig 5 participants 13 messages May 3, 2016 – May 12, 2016 5 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]

Jim Fehlig

author
#1 lore raw

PATCH 1/3 libxl: switch to using libxl_domain_create_restore from v4.4 API

In LIBXL_API_VERSION 0x040400, the libxl_domain_create_restore API gained a parameter for specifying restore parameters. Switch to using version 0x040400, which will be useful in a subsequent commit to specify the Xen migration stream version when restoring.

---
 configure.ac             | 9 +++++----
 src/libxl/libxl_domain.c | 6 +++++-
 2 files changed, 10 insertions(+), 5 deletions(-)
configure.ac +5 -4
index 88e2e20..0da0f75 100644
@@ -875,10 +875,11 @@ if test "$with_libxl" != "no" ; then
     fi
 fi
 
-# Until there is a need to use enhancements of libxl APIs such as
-# libxl_domain_create_restore and libxl_set_vcpuaffinity, stick with
-# the APIs as defined in libxl API version 4.2.0.
-LIBXL_CFLAGS="$LIBXL_CFLAGS -DLIBXL_API_VERSION=0x040200"
+# LIBXL_API_VERSION 4.4.0 introduced a new parameter to
+# libxl_domain_create_restore for specifying restore parameters.
+# The libxl driver will make use of this new parameter for specifying
+# the Xen migration stream version.
+LIBXL_CFLAGS="$LIBXL_CFLAGS -DLIBXL_API_VERSION=0x040400"
 LIBS="$old_LIBS"
 CFLAGS="$old_CFLAGS"
 
src/libxl/libxl_domain.c +5 -1
index 14a900c..32ad946 100644
@@ -1028,6 +1028,7 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
     libxlDriverConfigPtr cfg;
     virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
     libxl_asyncprogress_how aop_console_how;
+    libxl_domain_restore_params params;
 
     libxl_domain_config_init(&d_config);
 
@@ -1115,8 +1116,11 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         ret = libxl_domain_create_new(cfg->ctx, &d_config,
                                       &domid, NULL, &aop_console_how);
     } else {
+        libxl_domain_restore_params_init(&params);
         ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
-                                          restore_fd, NULL, &aop_console_how);
+                                          restore_fd, &params, NULL,
+                                          &aop_console_how);
+        libxl_domain_restore_params_dispose(&params);
     }
     virObjectLock(vm);
 
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#2 lore raw

PATCH 2/3 libxl: support Xen migration stream V2 in save/restore

In reply to a message not in the archive

Xen 4.6 introduced a new migration stream commonly referred to as "migration V2". Xen 4.6 and newer always produce this new stream, whereas Xen 4.5 and older always produce the legacy stream. Support for migration stream V2 can be detected at build time with LIBXL_HAVE_SRM_V2 from libxl.h. The legacy and V2 streams are not compatible, but a V2 host can accept and convert a legacy stream.

Commit e7440656 changed the libxl driver to use the lowest libxl API version possible (version 0x040200) to ensure the driver builds against older Xen releases. The old 4.2 restore API does not support specifying a stream version and assumes a legacy stream, even if the incoming stream is migration V2. Thinking it has been given a legacy stream, libxl will fail to convert an incoming stream that is already V2, which causes the entire restore operation to fail. Xen's libvirt-related OSSTest has been failing since commit e7440656 landed in libvirt.git master. One of the more recent failures can be seen here

http://lists.xenproject.org/archives/html/xen-devel/2016-05/msg00071.html

This patch changes the call to libxl_domain_create_restore() to include the stream version if LIBXL_HAVE_SRM_V2 is defined. The version field of the libxlSavefileHeader struct is also updated to '2' when LIBXL_HAVE_SRM_V2 is defined, ensuring the stream version in the header matches the actual stream version produced by Xen. Along with bumping the libxl API requirement to 0x040400, this patch fixes save/restore on a migration V2 Xen host.

Oddly, migration has never used the libxlSavefileHeader. It handles passing configuration in the Begin and Prepare phases, and then calls libxl directly to transfer domain state/memory in the Perform phase. A subsequent patch will add stream version handling in the Begin and Prepare phase handshaking, which will fix the migration related OSSTest failures.

---
 src/libxl/libxl_conf.h      |  6 +++++-
 src/libxl/libxl_domain.c    | 40 ++++++++++++++++++++++++++++++++++++----
 src/libxl/libxl_domain.h    | 14 ++++++++++----
 src/libxl/libxl_driver.c    | 13 ++++++++-----
 src/libxl/libxl_migration.c |  2 +-
 5 files changed, 60 insertions(+), 15 deletions(-)
src/libxl/libxl_conf.h +5 -1
index 24e2911..c5b9429 100644
@@ -148,7 +148,11 @@ struct _libxlDriverPrivate {
 };
 
 # define LIBXL_SAVE_MAGIC "libvirt-xml\n \0 \r"
-# define LIBXL_SAVE_VERSION 1
+# ifdef LIBXL_HAVE_SRM_V2
+#  define LIBXL_SAVE_VERSION 2
+# else
+#  define LIBXL_SAVE_VERSION 1
+# endif
 
 typedef struct _libxlSavefileHeader libxlSavefileHeader;
 typedef libxlSavefileHeader *libxlSavefileHeaderPtr;
src/libxl/libxl_domain.c +36 -4
index 32ad946..5fa1bd9 100644
@@ -514,7 +514,7 @@ libxlDomainShutdownThread(void *opaque)
     }
     libxlDomainDestroyInternal(driver, vm);
     libxlDomainCleanup(driver, vm);
-    if (libxlDomainStart(driver, vm, false, -1) < 0) {
+    if (libxlDomainStartNew(driver, vm, false) < 0) {
         virErrorPtr err = virGetLastError();
         VIR_ERROR(_("Failed to restart VM '%s': %s"),
                   vm->def->name, err ? err->message : _("unknown error"));
@@ -1006,14 +1006,23 @@ libxlDomainCreateIfaceNames(virDomainDefPtr def, libxl_domain_config *d_config)
 }
 
 
+#ifdef LIBXL_HAVE_SRM_V2
+# define LIBXL_DOMSTART_RESTORE_VER_ATTR /* empty */
+#else
+# define LIBXL_DOMSTART_RESTORE_VER_ATTR ATTRIBUTE_UNUSED
+#endif
+
 /*
  * Start a domain through libxenlight.
  *
  * virDomainObjPtr must be locked and a job acquired on invocation
  */
-int
-libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
-                 bool start_paused, int restore_fd)
+static int
+libxlDomainStart(libxlDriverPrivatePtr driver,
+                 virDomainObjPtr vm,
+                 bool start_paused,
+                 int restore_fd,
+                 uint32_t restore_ver LIBXL_DOMSTART_RESTORE_VER_ATTR)
 {
     libxl_domain_config d_config;
     virDomainDefPtr def = NULL;
@@ -1049,6 +1058,7 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
                 goto cleanup;
 
             restore_fd = managed_save_fd;
+            restore_ver = hdr.version;
 
             if (STRNEQ(vm->def->name, def->name) ||
                 memcmp(vm->def->uuid, def->uuid, VIR_UUID_BUFLEN)) {
@@ -1117,6 +1127,9 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
                                       &domid, NULL, &aop_console_how);
     } else {
         libxl_domain_restore_params_init(&params);
+#ifdef LIBXL_HAVE_SRM_V2
+        params.stream_version = restore_ver;
+#endif
         ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
                                           restore_fd, &params, NULL,
                                           &aop_console_how);
@@ -1203,6 +1216,25 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
     return ret;
 }
 
+int
+libxlDomainStartNew(libxlDriverPrivatePtr driver,
+            virDomainObjPtr vm,
+            bool start_paused)
+{
+    return libxlDomainStart(driver, vm, start_paused, -1, LIBXL_SAVE_VERSION);
+}
+
+int
+libxlDomainStartRestore(libxlDriverPrivatePtr driver,
+                        virDomainObjPtr vm,
+                        bool start_paused,
+                        int restore_fd,
+                        uint32_t restore_ver)
+{
+    return libxlDomainStart(driver, vm, start_paused,
+                            restore_fd, restore_ver);
+}
+
 bool
 libxlDomainDefCheckABIStability(libxlDriverPrivatePtr driver,
                                 virDomainDefPtr src,
src/libxl/libxl_domain.h +10 -4
index 1c1eba3..c53adaa 100644
@@ -142,10 +142,16 @@ libxlDomainSetVcpuAffinities(libxlDriverPrivatePtr driver,
                              virDomainObjPtr vm);
 
 int
-libxlDomainStart(libxlDriverPrivatePtr driver,
-                 virDomainObjPtr vm,
-                 bool start_paused,
-                 int restore_fd);
+libxlDomainStartNew(libxlDriverPrivatePtr driver,
+                    virDomainObjPtr vm,
+                    bool start_paused);
+
+int
+libxlDomainStartRestore(libxlDriverPrivatePtr driver,
+                        virDomainObjPtr vm,
+                        bool start_paused,
+                        int restore_fd,
+                        uint32_t restore_ver);
 
 bool
 libxlDomainDefCheckABIStability(libxlDriverPrivatePtr driver,
src/libxl/libxl_driver.c +8 -5
index bf97c9c..8977ae2 100644
@@ -323,7 +323,7 @@ libxlAutostartDomain(virDomainObjPtr vm,
     }
 
     if (vm->autostart && !virDomainObjIsActive(vm) &&
-        libxlDomainStart(driver, vm, false, -1) < 0) {
+        libxlDomainStartNew(driver, vm, false) < 0) {
         err = virGetLastError();
         VIR_ERROR(_("Failed to autostart VM '%s': %s"),
                   vm->def->name,
@@ -998,8 +998,8 @@ libxlDomainCreateXML(virConnectPtr conn, const char *xml,
         goto cleanup;
     }
 
-    if (libxlDomainStart(driver, vm, (flags & VIR_DOMAIN_START_PAUSED) != 0,
-                     -1) < 0) {
+    if (libxlDomainStartNew(driver, vm,
+                         (flags & VIR_DOMAIN_START_PAUSED) != 0) < 0) {
         if (!vm->persistent) {
             virDomainObjListRemove(driver->domains, vm);
             vm = NULL;
@@ -1818,7 +1818,9 @@ libxlDomainRestoreFlags(virConnectPtr conn, const char *from,
         goto cleanup;
     }
 
-    ret = libxlDomainStart(driver, vm, (flags & VIR_DOMAIN_SAVE_PAUSED) != 0, fd);
+    ret = libxlDomainStartRestore(driver, vm,
+                                  (flags & VIR_DOMAIN_SAVE_PAUSED) != 0,
+                                  fd, hdr.version);
     if (ret < 0 && !vm->persistent)
         virDomainObjListRemove(driver->domains, vm);
 
@@ -2681,7 +2683,8 @@ libxlDomainCreateWithFlags(virDomainPtr dom,
         goto endjob;
     }
 
-    ret = libxlDomainStart(driver, vm, (flags & VIR_DOMAIN_START_PAUSED) != 0, -1);
+    ret = libxlDomainStartNew(driver, vm,
+                              (flags & VIR_DOMAIN_START_PAUSED) != 0);
     if (ret < 0)
         goto endjob;
     dom->id = vm->def->id;
src/libxl/libxl_migration.c +1 -1
index ab1f76e..1d4ec5e 100644
@@ -106,7 +106,7 @@ libxlDoMigrateReceive(void *opaque)
      * Always start the domain paused.  If needed, unpause in the
      * finish phase, after transfer of the domain is complete.
      */
-    ret = libxlDomainStart(driver, vm, true, recvfd);
+    ret = libxlDomainStartRestore(driver, vm, true, recvfd, LIBXL_SAVE_VERSION);
 
     if (ret < 0 && !vm->persistent)
         remove_dom = true;
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#3 lore raw

PATCH 3/3 libxl: support migration stream V2 in migration

In reply to a message not in the archive

Similar to "support Xen migration stream V2 in save/restore", add support for indicating the migration stream version in the migration code. To accomplish this, add a minimal migration cookie in the libxl driver that is passed between source and destination hosts. Initially, the cookie is only used in the Begin and Prepare phases of migration to communicate the version of the migration stream produced by the source.

---
 src/libxl/libxl_driver.c    |  14 +--
 src/libxl/libxl_migration.c | 204 +++++++++++++++++++++++++++++++++++++++++++-
 src/libxl/libxl_migration.h |   6 +-
 3 files changed, 213 insertions(+), 11 deletions(-)
src/libxl/libxl_driver.c +8 -6
index 8977ae2..062d6f8 100644
@@ -5151,8 +5151,8 @@ static char *
 libxlDomainMigrateBegin3Params(virDomainPtr domain,
                                virTypedParameterPtr params,
                                int nparams,
-                               char **cookieout ATTRIBUTE_UNUSED,
-                               int *cookieoutlen ATTRIBUTE_UNUSED,
+                               char **cookieout,
+                               int *cookieoutlen,
                                unsigned int flags)
 {
     const char *xmlin = NULL;
@@ -5193,15 +5193,16 @@ libxlDomainMigrateBegin3Params(virDomainPtr domain,
         return NULL;
     }
 
-    return libxlDomainMigrationBegin(domain->conn, vm, xmlin);
+    return libxlDomainMigrationBegin(domain->conn, vm, xmlin,
+                                     cookieout, cookieoutlen);
 }
 
 static int
 libxlDomainMigratePrepare3Params(virConnectPtr dconn,
                                  virTypedParameterPtr params,
                                  int nparams,
-                                 const char *cookiein ATTRIBUTE_UNUSED,
-                                 int cookieinlen ATTRIBUTE_UNUSED,
+                                 const char *cookiein,
+                                 int cookieinlen,
                                  char **cookieout ATTRIBUTE_UNUSED,
                                  int *cookieoutlen ATTRIBUTE_UNUSED,
                                  char **uri_out,
@@ -5240,7 +5241,8 @@ libxlDomainMigratePrepare3Params(virConnectPtr dconn,
     if (virDomainMigratePrepare3ParamsEnsureACL(dconn, def) < 0)
         goto error;
 
-    if (libxlDomainMigrationPrepare(dconn, &def, uri_in, uri_out, flags) < 0)
+    if (libxlDomainMigrationPrepare(dconn, &def, uri_in, uri_out,
+                                    cookiein, cookieinlen, flags) < 0)
         goto error;
 
     return 0;
src/libxl/libxl_migration.c +200 -4

291 lines not on this page · raw message

src/libxl/libxl_migration.h +5 -1
index 0f83bb4..c02026d 100644
@@ -42,7 +42,9 @@
 char *
 libxlDomainMigrationBegin(virConnectPtr conn,
                           virDomainObjPtr vm,
-                          const char *xmlin);
+                          const char *xmlin,
+                          char **cookieout,
+                          int *cookieoutlen);
 
 virDomainDefPtr
 libxlDomainMigrationPrepareDef(libxlDriverPrivatePtr driver,
@@ -54,6 +56,8 @@ libxlDomainMigrationPrepare(virConnectPtr dconn,
                             virDomainDefPtr *def,
                             const char *uri_in,
                             char **uri_out,
+                            const char *cookiein,
+                            int cookieinlen,
                             unsigned int flags);
 
 int
Signature · 7 lines
2.1.4


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

Re: [PATCH 0/3] libxl: support Xen migration stream V2

In reply to a message not in the archive
Quoted 16 lines · Jim Fehlig

Hi all,

This patch adds support for Xen migration stream V2 to the libvirt libxl driver. In the process it fixes save/restore and migration tests in OSSTest, which have been failing since libvirt commit e7440656.

Patch1 changes the libxl API requirement from version 4.2 to 4.4, enabling use of an extended libxl_domain_create_restore() function that allows passing restore parameters such as stream version.

Patch2 adds support for migration stream V2 in the basic save/restore logic, taking advantage of a save image header that includes a version field. The version is set to '2' if the host produces a V2 migration stream. This patch fixes the failing save/restore tests in OSSTest.

Quoted 10 lines

Patch3 adds support for migration stream V2 in the migration logic. The migration code does not use the save image header and instead uses libvirt's migration protocol to transfer domain configuration and other such goodies from source to destination. The patch enables sending version information in the Begin and Prepare migration phases so the correct stream version information can be passed to libxl_domain_create_restore(). An upshot of this approach is safely detecting and aborting a migration from a V2 host to a V1-only host. This patch fixes the failing migration tests in OSSTest.

LGTM (although I can't comment on the libvirt internals).

~Andrew

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

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

Reviewed-by
#6 lore raw
Quoted 6 lines · Jim Fehlig

In LIBXL_API_VERSION 0x040400, the libxl_domain_create_restore API gained a parameter for specifying restore parameters. Switch to using version 0x040400, which will be useful in a subsequent commit to specify the Xen migration stream version when restoring.

Quoted 53 lines
---
 configure.ac             | 9 +++++----
 src/libxl/libxl_domain.c | 6 +++++-
 2 files changed, 10 insertions(+), 5 deletions(-)
configure.ac +5 -4
index 88e2e20..0da0f75 100644
@@ -875,10 +875,11 @@ if test "$with_libxl" != "no" ; then
     fi
 fi
 
-# Until there is a need to use enhancements of libxl APIs such as
-# libxl_domain_create_restore and libxl_set_vcpuaffinity, stick with
-# the APIs as defined in libxl API version 4.2.0.
-LIBXL_CFLAGS="$LIBXL_CFLAGS -DLIBXL_API_VERSION=0x040200"
+# LIBXL_API_VERSION 4.4.0 introduced a new parameter to
+# libxl_domain_create_restore for specifying restore parameters.
+# The libxl driver will make use of this new parameter for specifying
+# the Xen migration stream version.
+LIBXL_CFLAGS="$LIBXL_CFLAGS -DLIBXL_API_VERSION=0x040400"
 LIBS="$old_LIBS"
 CFLAGS="$old_CFLAGS"
 
src/libxl/libxl_domain.c +5 -1
index 14a900c..32ad946 100644
@@ -1028,6 +1028,7 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
     libxlDriverConfigPtr cfg;
     virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
     libxl_asyncprogress_how aop_console_how;
+    libxl_domain_restore_params params;
 
     libxl_domain_config_init(&d_config);
 
@@ -1115,8 +1116,11 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         ret = libxl_domain_create_new(cfg->ctx, &d_config,
                                       &domid, NULL, &aop_console_how);
     } else {
+        libxl_domain_restore_params_init(&params);
         ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
-                                          restore_fd, NULL, &aop_console_how);
+                                          restore_fd, &params, NULL,
+                                          &aop_console_how);
+        libxl_domain_restore_params_dispose(&params);
     }
     virObjectLock(vm);
 
Signature · 1 line
2.1.4

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

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

In LIBXL_API_VERSION 0x040400, the libxl_domain_create_restore API gained a parameter for specifying restore parameters. Switch to using version 0x040400, which will be useful in a subsequent commit to specify the Xen migration stream version when restoring.

This breaks compilation with xen-4.3 etc. Is this intentional?

Olaf

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

author
#8 lore raw
Quoted 7 lines · Olaf Hering
Quoted 4 lines · Jim Fehlig

In LIBXL_API_VERSION 0x040400, the libxl_domain_create_restore API gained a parameter for specifying restore parameters. Switch to using version 0x040400, which will be useful in a subsequent commit to specify the Xen migration stream version when restoring.

This breaks compilation with xen-4.3 etc. Is this intentional?

Yes. Did you see my message elsewhere in the thread when I notified I was pushing the series?

https://www.redhat.com/archives/libvir-list/2016-May/msg00686.html

Regards,
Jim

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

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

author
#11 lore raw
Quoted 5 lines · Olaf Hering
Quoted 1 line · Jim Fehlig

https://www.redhat.com/archives/libvir-list/2016-May/msg00686.html

Perhaps configure.ac should be changed to reject libxl upfront.

Yes, good idea.

Quoted 4 lines

It looks
like the assignment of LIBXL_CFLAGS should be moved up, so that AC_CHECK_LIB gets the -DLIBXL_API_VERSION as well. I will provide a patch for that.

Ok, thanks for volunteering!

Regards,
Jim

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

#12 lore raw

Re: [PATCH 0/3] libxl: support Xen migration stream V2

In reply to a message not in the archive
Quoted 16 lines · Jim Fehlig

Hi all,

This patch adds support for Xen migration stream V2 to the libvirt libxl driver. In the process it fixes save/restore and migration tests in OSSTest, which have been failing since libvirt commit e7440656.

Patch1 changes the libxl API requirement from version 4.2 to 4.4, enabling use of an extended libxl_domain_create_restore() function that allows passing restore parameters such as stream version.

Patch2 adds support for migration stream V2 in the basic save/restore logic, taking advantage of a save image header that includes a version field. The version is set to '2' if the host produces a V2 migration stream. This patch fixes the failing save/restore tests in OSSTest.

Quoted 11 lines

Patch3 adds support for migration stream V2 in the migration logic. The migration code does not use the save image header and instead uses libvirt's migration protocol to transfer domain configuration and other such goodies from source to destination. The patch enables sending version information in the Begin and Prepare migration phases so the correct stream version information can be passed to libxl_domain_create_restore(). An upshot of this approach is safely detecting and aborting a migration from a V2 host to a V1-only host. This patch fixes the failing migration tests in OSSTest.

The general approach looks good to me.

Wei.

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

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

author
#14 lore raw

Re: [PATCH 0/3] libxl: support Xen migration stream V2

Quoted 28 lines · Wei Liu
Quoted 16 lines · Jim Fehlig

Hi all,

This patch adds support for Xen migration stream V2 to the libvirt libxl driver. In the process it fixes save/restore and migration tests in OSSTest, which have been failing since libvirt commit e7440656.

Patch1 changes the libxl API requirement from version 4.2 to 4.4, enabling use of an extended libxl_domain_create_restore() function that allows passing restore parameters such as stream version.

Patch2 adds support for migration stream V2 in the basic save/restore logic, taking advantage of a save image header that includes a version field. The version is set to '2' if the host produces a V2 migration stream. This patch fixes the failing save/restore tests in OSSTest.

Quoted 11 lines

Patch3 adds support for migration stream V2 in the migration logic. The migration code does not use the save image header and instead uses libvirt's migration protocol to transfer domain configuration and other such goodies from source to destination. The patch enables sending version information in the Begin and Prepare migration phases so the correct stream version information can be passed to libxl_domain_create_restore(). An upshot of this approach is safely detecting and aborting a migration from a V2 host to a V1-only host. This patch fixes the failing migration tests in OSSTest.

Quoted 1 line

The general approach looks good to me.

Any comments on this series from libvirt maintainers? Would be nice to get this series (or a variant) committed, fixing the daily OSSTest failures. For your viewing pleasure, here's a link to today's failure

http://logs.test-lab.xenproject.org/osstest/logs/93880/

Regards,
Jim

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

#15 lore raw

Re: [libvirt] [PATCH 0/3] libxl: support Xen migration stream V2

In reply to a message not in the archive
Quoted 32 lines · Jim Fehlig

Hi all,

This patch adds support for Xen migration stream V2 to the libvirt libxl driver. In the process it fixes save/restore and migration tests in OSSTest, which have been failing since libvirt commit e7440656.

Patch1 changes the libxl API requirement from version 4.2 to 4.4, enabling use of an extended libxl_domain_create_restore() function that allows passing restore parameters such as stream version.

Patch2 adds support for migration stream V2 in the basic save/restore logic, taking advantage of a save image header that includes a version field. The version is set to '2' if the host produces a V2 migration stream. This patch fixes the failing save/restore tests in OSSTest.

Patch3 adds support for migration stream V2 in the migration logic. The migration code does not use the save image header and instead uses libvirt's migration protocol to transfer domain configuration and other such goodies from source to destination. The patch enables sending version information in the Begin and Prepare migration phases so the correct stream version information can be passed to libxl_domain_create_restore(). An upshot of this approach is safely detecting and aborting a migration from a V2 host to a V1-only host. This patch fixes the failing migration tests in OSSTest.

Jim Fehlig (3):
libxl: switch to using libxl_domain_create_restore from v4.4 API
libxl: support Xen migration stream V2 in save/restore
libxl: support migration stream V2 in migration

Quoted 8 lines
 configure.ac                |   9 +-
 src/libxl/libxl_conf.h      |   6 +-
 src/libxl/libxl_domain.c    |  46 ++++++++--
 src/libxl/libxl_domain.h    |  14 ++-
 src/libxl/libxl_driver.c    |  27 +++---
 src/libxl/libxl_migration.c | 204 +++++++++++++++++++++++++++++++++++++++++++-
 src/libxl/libxl_migration.h |   6 +-
 7 files changed, 282 insertions(+), 30 deletions(-)

ACK series

Jan

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

A message that is not in the archive (sent off-list or not yet received): 20160510105125.GB15123@dnr

author
#17 lore raw

Re: [libvirt] [PATCH 0/3] libxl: support Xen migration stream V2

Quoted 42 lines · Ján Tomko
Quoted 32 lines · Jim Fehlig

Hi all,

This patch adds support for Xen migration stream V2 to the libvirt libxl driver. In the process it fixes save/restore and migration tests in OSSTest, which have been failing since libvirt commit e7440656.

Patch1 changes the libxl API requirement from version 4.2 to 4.4, enabling use of an extended libxl_domain_create_restore() function that allows passing restore parameters such as stream version.

Patch2 adds support for migration stream V2 in the basic save/restore logic, taking advantage of a save image header that includes a version field. The version is set to '2' if the host produces a V2 migration stream. This patch fixes the failing save/restore tests in OSSTest.

Patch3 adds support for migration stream V2 in the migration logic. The migration code does not use the save image header and instead uses libvirt's migration protocol to transfer domain configuration and other such goodies from source to destination. The patch enables sending version information in the Begin and Prepare migration phases so the correct stream version information can be passed to libxl_domain_create_restore(). An upshot of this approach is safely detecting and aborting a migration from a V2 host to a V1-only host. This patch fixes the failing migration tests in OSSTest.

Jim Fehlig (3):
libxl: switch to using libxl_domain_create_restore from v4.4 API
libxl: support Xen migration stream V2 in save/restore
libxl: support migration stream V2 in migration

Quoted 8 lines
 configure.ac                |   9 +-
 src/libxl/libxl_conf.h      |   6 +-
 src/libxl/libxl_domain.c    |  46 ++++++++--
 src/libxl/libxl_domain.h    |  14 ++-
 src/libxl/libxl_driver.c    |  27 +++---
 src/libxl/libxl_migration.c | 204 +++++++++++++++++++++++++++++++++++++++++++-
 src/libxl/libxl_migration.h |   6 +-
 7 files changed, 282 insertions(+), 30 deletions(-)
Quoted 1 line

ACK series

Thanks, pushed now.

Note to all: With this change, libvirt.git will no longer build with Xen < 4.4. Wearing either upstream maintainer or distro packager hat, I don't really care :-).

With upstream hat on, Xen 4.2 is no longer maintained. Xen 4.3 saw the end of general support in Jan 2015 and will end the subsequent 18 months of security support in early July. So in a little over a month 4.3 will be dead.

With distro packager hat on, I'm not interested in using a new libvirt with such an old Xen. I hope others feel the same. If not, patches are welcome.

Regards,
Jim

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