]> git.ipfire.org Git - thirdparty/libvirt.git/commit
meson: improve CPU affinity routines check
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Sun, 21 Nov 2021 11:56:06 +0000 (15:56 +0400)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Tue, 23 Nov 2021 11:11:00 +0000 (15:11 +0400)
commitc07cf0a68693f183948a332d86c4d86a26a9c551
treebfd695ed9a2d04f4b82c3a290f45674098400577
parent9b0a6d959b9420c82231f64fd11a575078bdaf89
meson: improve CPU affinity routines check

Recently, FreeBSD has got sched_get/setaffinity(3) implementations and
the sched.h header as well [1]. To make these routines visible,
users have to define _WITH_CPU_SET_T.

This breaks current detection. Specifically, meson sees the
sched_getaffinity() symbol and defines WITH_SCHED_GETAFFINITY. This
define unlocks Linux implementation of virProcessSetAffinity() and other
functions, which fails to build on FreeBSD because cpu_set_t is not
visible as _WITH_CPU_SET_T is not defined.

For now, change detection to the following:

 - Instead of checking sched_getaffinity(), check if 'cpu_set_t' is
   available through sched.h
 - Explicitly check the sched.h header instead of assuming its presence
   if WITH_SCHED_SETSCHEDULER is defined

1:
https://cgit.freebsd.org/src/commit/?id=43736b71dd051212d5c55be9fa21c45993017fbb
https://cgit.freebsd.org/src/commit/?id=160b4b922b6021848b6b48afc894d16b879b7af2
https://cgit.freebsd.org/src/commit/?id=90fa9705d5cd29cf11c5dc7319299788dec2546a

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
meson.build
src/util/virprocess.c