]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
libxl: use LIBXL_API_VERSION 0x040200
authorJim Fehlig <jfehlig@suse.com>
Thu, 14 Apr 2016 22:10:32 +0000 (16:10 -0600)
committerCole Robinson <crobinso@redhat.com>
Wed, 20 Apr 2016 13:24:53 +0000 (09:24 -0400)
To ensure the libvirt libxl driver will build with future versions
of Xen where the libxl API may change in incompatible ways,
explicitly use LIBXL_API_VERSION 0x040200. The libxl driver
does use new libxl APIs that have been added since Xen 4.2, but
currently it does not make use of any changes made to existing
APIs such as libxl_domain_create_restore or libxl_set_vcpuaffinity.
The version can be bumped if/when the libxl driver consumes the
changed APIs.

Further details can be found in the following discussion thread

https://www.redhat.com/archives/libvir-list/2016-April/msg00178.html
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
(cherry picked from commit e744065679ccba8471d28b2cf6e93f443cd20c8c)

configure.ac
src/libxl/libxl_conf.h
src/libxl/libxl_domain.c

index 718a4019cf7eafed1063ddb5bb96965696ffcb34..529e749316ca55376f98b55eac2352914d40fb8f 100644 (file)
@@ -916,6 +916,10 @@ 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"
 LIBS="$old_LIBS"
 CFLAGS="$old_CFLAGS"
 
index 3c0eafb043b3bc066084e9ddbc1d0439ff7630f0..24e29116f2ef7b103ccb852262c3004a18a530e4 100644 (file)
 # endif
 
 
-/* libxl interface for setting VCPU affinity changed in 4.5. In fact, a new
- * parameter has been added, representative of 'VCPU soft affinity'. If one
- * does not care about it (and that's libvirt case), passing NULL is the
- * right thing to do. To mark that change, LIBXL_HAVE_VCPUINFO_SOFT_AFFINITY
- * is defined. */
-# ifdef LIBXL_HAVE_VCPUINFO_SOFT_AFFINITY
-#  define libxl_set_vcpuaffinity(ctx, domid, vcpuid, map) \
-    libxl_set_vcpuaffinity((ctx), (domid), (vcpuid), (map), NULL)
-#  define libxl_set_vcpuaffinity_all(ctx, domid, max_vcpus, map) \
-    libxl_set_vcpuaffinity_all((ctx), (domid), (max_vcpus), (map), NULL)
-# endif
-
 typedef struct _libxlDriverPrivate libxlDriverPrivate;
 typedef libxlDriverPrivate *libxlDriverPrivatePtr;
 
index aed904b7917ac0cda84396436a65ab88d7d6bbdc..192a506ba7afb090934ac94ff66c010721f818ee 100644 (file)
@@ -981,9 +981,6 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
     int managed_save_fd = -1;
     libxlDomainObjPrivatePtr priv = vm->privateData;
     libxlDriverConfigPtr cfg;
-#ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS
-    libxl_domain_restore_params params;
-#endif
     virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
     libxl_asyncprogress_how aop_console_how;
 
@@ -1070,20 +1067,8 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
         ret = libxl_domain_create_new(cfg->ctx, &d_config,
                                       &domid, NULL, &aop_console_how);
     } else {
-#if defined(LIBXL_HAVE_DOMAIN_CREATE_RESTORE_SEND_BACK_FD)
-        params.checkpointed_stream = 0;
-        ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
-                                          restore_fd, -1, &params, NULL,
-                                          &aop_console_how);
-#elif defined(LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS)
-        params.checkpointed_stream = 0;
-        ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
-                                          restore_fd, &params, NULL,
-                                          &aop_console_how);
-#else
         ret = libxl_domain_create_restore(cfg->ctx, &d_config, &domid,
                                           restore_fd, NULL, &aop_console_how);
-#endif
     }
     virObjectLock(vm);