kvm: Only include KVM support for supported kernels
This patch adds a check to ensure that the KVM API provided by the running kernel is what we are expecting.
This commit is contained in:
parent
2bcced5897
commit
05ed2deda6
1 changed files with 7 additions and 3 deletions
10
SConstruct
10
SConstruct
|
@ -936,10 +936,14 @@ if not have_fenv:
|
||||||
print "Warning: Header file <fenv.h> not found."
|
print "Warning: Header file <fenv.h> not found."
|
||||||
print " This host has no IEEE FP rounding mode control."
|
print " This host has no IEEE FP rounding mode control."
|
||||||
|
|
||||||
# Check if we should enable KVM-based hardware virtualization
|
# Check if we should enable KVM-based hardware virtualization. The API
|
||||||
have_kvm = conf.CheckHeader('linux/kvm.h', '<>')
|
# we rely on exists since version 2.6.36 of the kernel, but somehow
|
||||||
|
# the KVM_API_VERSION does not reflect the change. We test for one of
|
||||||
|
# the types as a fall back.
|
||||||
|
have_kvm = conf.CheckHeader('linux/kvm.h', '<>') and \
|
||||||
|
conf.CheckTypeSize('struct kvm_xsave', '#include <linux/kvm.h>') != 0
|
||||||
if not have_kvm:
|
if not have_kvm:
|
||||||
print "Info: Header file <linux/kvm.h> not found, " \
|
print "Info: Compatible header file <linux/kvm.h> not found, " \
|
||||||
"disabling KVM support."
|
"disabling KVM support."
|
||||||
|
|
||||||
# Check if the requested target ISA is compatible with the host
|
# Check if the requested target ISA is compatible with the host
|
||||||
|
|
Loading…
Reference in a new issue