Skip to content

Commit c4bbaaa

Browse files
author
root
committed
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.
1 parent baed692 commit c4bbaaa

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/domain_xl.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,22 @@
4444

4545
#include "clickos.h"
4646

47+
/*
48+
* This macro is taken from libvirt: https://gitlab.com/libvirt/libvirt/commit/bfc72e99920215c9b004a5380ca61fe6ff81ea6b
49+
*
50+
* libxl interface for setting VCPU affinity changed in 4.5. In fact, a new
51+
* parameter has been added, representative of 'VCPU soft affinity'. If one
52+
* does not care about it (and that's libvirt case), passing NULL is the
53+
* right thing to do. To mark that change, LIBXL_HAVE_VCPUINFO_SOFT_AFFINITY
54+
* is defined.
55+
*/
56+
# ifdef LIBXL_HAVE_VCPUINFO_SOFT_AFFINITY
57+
# define libxl_set_vcpuaffinity(ctx, domid, vcpuid, map) \
58+
libxl_set_vcpuaffinity((ctx), (domid), (vcpuid), (map), NULL)
59+
# define libxl_set_vcpuaffinity_all(ctx, domid, max_vcpus, map) \
60+
libxl_set_vcpuaffinity_all((ctx), (domid), (max_vcpus), (map), NULL)
61+
# endif
62+
4763
#define CHK_ERRNO( call ) ({ \
4864
int chk_errno = (call); \
4965
if (chk_errno < 0) { \

0 commit comments

Comments
 (0)