]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
fix api changes in xen restore
authorBamvor Jian Zhang <bjzhang@suse.com>
Fri, 1 Nov 2013 07:26:26 +0000 (15:26 +0800)
committerEric Blake <eblake@redhat.com>
Thu, 22 Jan 2015 21:37:29 +0000 (14:37 -0700)
in recently xen commit: 7051d5c8, there is a api changes in
libxl_domain_create_restore.
Author: Andrew Cooper <andrew.cooper3@citrix.com>
Date:   Thu Oct 10 12:23:10 2013 +0100

    tools/migrate: Fix regression when migrating from older version of Xen

use the macro LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS in libxl.h
in order to make libvirt could compile with old and new xen.

the params checkpointed_stream is useful if libvirt libxl driver
support migration. for new, set it as zero.

Signed-off-by: Bamvor Jian Zhang <bjzhang@suse.com>
(cherry picked from commit a52fa5569a90bc0e732e923da34d8b2aec68d751)

Conflicts:
src/libxl/libxl_driver.c - context: no commit d9f19c3

src/libxl/libxl_driver.c

index bed583b093b47eed17193f7913d89c2bce3d49a4..9748b3fc2c5ff0ca1c55a1d545b8f54bed58f650 100644 (file)
@@ -916,6 +916,9 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
     char *managed_save_path = NULL;
     int managed_save_fd = -1;
     libxlDomainObjPrivatePtr priv = vm->privateData;
+#ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS
+    libxl_domain_restore_params params;
+#endif
 
     /* If there is a managed saved state restore it instead of starting
      * from scratch. The old state is removed once the restoring succeeded. */
@@ -976,8 +979,14 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         ret = libxl_domain_create_new(priv->ctx, &d_config,
                                       &domid, NULL, NULL);
     else
+#ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS
+        params.checkpointed_stream = 0;
+        ret = libxl_domain_create_restore(priv->ctx, &d_config, &domid,
+                                          restore_fd, &params, NULL, NULL);
+#else
         ret = libxl_domain_create_restore(priv->ctx, &d_config, &domid,
                                           restore_fd, NULL, NULL);
+#endif
 
     if (ret) {
         if (restore_fd < 0)