From c4bbaaa669f2d37f24ab0f247bbf77d0053a1688 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 24 Apr 2015 14:24:05 +0200 Subject: [PATCH] domain/xl: import vcpuaffinity macro from libvirt This patch includes a macro from libvirt to fix issues with libxl_set_vcpuaffinity() that arise with newer xen versions. Beginning with version 4.5 the functions requires an additional parameter for 'VCPU soft affinity' that cosmos does not use anyway. The macro is taken from linvirt. See https://gitlab.com/libvirt/libvirt/commit/bfc72e99920215c9b004a5380ca61fe6ff81ea6b for more details. --- src/domain_xl.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/domain_xl.c b/src/domain_xl.c index f7d164f..cd38820 100644 --- a/src/domain_xl.c +++ b/src/domain_xl.c @@ -44,6 +44,22 @@ #include "clickos.h" +/* + * This macro is taken from libvirt: https://gitlab.com/libvirt/libvirt/commit/bfc72e99920215c9b004a5380ca61fe6ff81ea6b + * + * 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 + #define CHK_ERRNO( call ) ({ \ int chk_errno = (call); \ if (chk_errno < 0) { \