Skip to content

Commit

Permalink
domain/xl: import vcpuaffinity macro from libvirt
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
root committed May 8, 2015
1 parent baed692 commit c4bbaaa
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/domain_xl.c
Expand Up @@ -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) { \
Expand Down

0 comments on commit c4bbaaa

Please sign in to comment.