]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
libxl: don't break the build on Xen>=4.5 because of libxl_vcpu_setaffinity()
authorDario Faggioli <dario.faggioli@citrix.com>
Mon, 30 Jun 2014 17:19:01 +0000 (19:19 +0200)
committerJim Fehlig <jfehlig@suse.com>
Mon, 30 Jun 2014 20:49:22 +0000 (14:49 -0600)
libxl interface for vcpu pinning is changing in Xen 4.5. Basically,
libxl_set_vcpuaffinity() now wants one more parameter. That is
representative of 'VCPU soft affinity', which libvirt does not use.

To mark such change, the macro LIBXL_HAVE_VCPUINFO_SOFT_AFFINITY is
defined. Use it as a gate and, if present, re-#define the calls from
the old to the new interface, to avoid breaking the build.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Cc: Jim Fehlig <jfehlig@suse.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
src/libxl/libxl_conf.h

index 6aa36d27395edce5095bf278253801ac40a7bcd9..da66b4ef53571f5872b5a63ac0feb7681f82d9e5 100644 (file)
 # define LIBXL_DUMP_DIR LIBXL_LIB_DIR "/dump"
 # define LIBXL_BOOTLOADER_PATH BINDIR "/pygrub"
 
+/* 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;