mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-31 05:57:16 +00:00
maint: add configure checks for BSD CPU affinity
Check for presence of sys/cpuset.h header and cpuset_getaffinity() in configure instead of just using #ifdef __FreeBSD__ for that code.
This commit is contained in:
parent
122cd16982
commit
d779d218d4
10
configure.ac
10
configure.ac
@ -2604,6 +2604,16 @@ AC_CHECK_DECLS([BRDGSFD, BRDGADD, BRDGDEL],
|
|||||||
#include <net/if_bridgevar.h>
|
#include <net/if_bridgevar.h>
|
||||||
])
|
])
|
||||||
|
|
||||||
|
# Check for BSD CPU affinity availability
|
||||||
|
AC_CHECK_DECLS([cpuset_getaffinity],
|
||||||
|
[AC_DEFINE([HAVE_BSD_CPU_AFFINITY],
|
||||||
|
[1],
|
||||||
|
[whether BSD CPU affinity management is available])],
|
||||||
|
[],
|
||||||
|
[#include <sys/param.h>
|
||||||
|
#include <sys/cpuset.h>
|
||||||
|
])
|
||||||
|
|
||||||
# Check if we need to look for ifconfig
|
# Check if we need to look for ifconfig
|
||||||
if test "$want_ifconfig" = "yes"; then
|
if test "$want_ifconfig" = "yes"; then
|
||||||
AC_PATH_PROG([IFCONFIG_PATH], [ifconfig])
|
AC_PATH_PROG([IFCONFIG_PATH], [ifconfig])
|
||||||
|
@ -34,11 +34,14 @@
|
|||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
# include <sys/param.h>
|
# include <sys/param.h>
|
||||||
# include <sys/cpuset.h>
|
|
||||||
# include <sys/sysctl.h>
|
# include <sys/sysctl.h>
|
||||||
# include <sys/user.h>
|
# include <sys/user.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_BSD_CPU_AFFINITY
|
||||||
|
# include <sys/cpuset.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "viratomic.h"
|
#include "viratomic.h"
|
||||||
#include "virprocess.h"
|
#include "virprocess.h"
|
||||||
#include "virerror.h"
|
#include "virerror.h"
|
||||||
@ -457,7 +460,7 @@ realloc:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(HAVE_BSD_CPU_AFFINITY)
|
||||||
|
|
||||||
int virProcessSetAffinity(pid_t pid ATTRIBUTE_UNUSED,
|
int virProcessSetAffinity(pid_t pid ATTRIBUTE_UNUSED,
|
||||||
virBitmapPtr map)
|
virBitmapPtr map)
|
||||||
|
Loading…
Reference in New Issue
Block a user