summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Faggioli <dario.faggioli@citrix.com>2014-06-30 19:19:01 +0200
committerEric Blake <eblake@redhat.com>2015-12-16 13:05:32 -0700
commit7ceeb5e4a1a8ddefd454ba4e092e8ddf4e05f186 (patch)
tree107cb078eb6d8c219fa03ca41a297864b1548a7e
parent7227fbbabf8a26f68114070cc5390f5e6d920a88 (diff)
downloadlibvirt-7ceeb5e4a1a8ddefd454ba4e092e8ddf4e05f186.tar.gz
libxl: don't break the build on Xen>=4.5 because of libxl_vcpu_setaffinity()
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> (cherry picked from commit bfc72e99920215c9b004a5380ca61fe6ff81ea6b)
-rw-r--r--src/libxl/libxl_conf.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
index 942cdd5acb..a6deb946ec 100644
--- a/src/libxl/libxl_conf.h
+++ b/src/libxl/libxl_conf.h
@@ -47,6 +47,17 @@
# define LIBXL_SAVE_DIR LIBXL_LIB_DIR "/save"
# 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;