2009-03-04 00:11:57 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2012-10-11 16:01:59 +00:00
|
|
|
case $(uname -m) in
|
|
|
|
i?86|x86_64)
|
|
|
|
grep vmx /proc/cpuinfo >/dev/null 2>&1 && vmx=1
|
|
|
|
grep svm /proc/cpuinfo >/dev/null 2>&1 && svm=1
|
2009-03-04 00:11:57 +00:00
|
|
|
|
2012-10-11 16:01:59 +00:00
|
|
|
if [ "$vmx" ] || [ "$svm" ]; then
|
2012-10-19 08:15:31 +00:00
|
|
|
[ "$vmx" ] && modprobe -b kvm-intel >/dev/null 2>&1 && kvm=1
|
|
|
|
[ "$svm" ] && modprobe -b kvm-amd >/dev/null 2>&1 && kvm=1
|
2012-10-11 16:01:59 +00:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
ppc64)
|
|
|
|
grep OPAL /proc/cpuinfo >/dev/null 2>&1 && opal=1
|
|
|
|
|
|
|
|
if [ "$opal" ]; then
|
2012-10-19 08:15:31 +00:00
|
|
|
modprobe -b kvm >/dev/null 2>&1 && kvm=1
|
2012-10-11 16:01:59 +00:00
|
|
|
fi
|
|
|
|
;;
|
2012-10-19 08:15:31 +00:00
|
|
|
s390x)
|
|
|
|
modprobe -b kvm >/dev/null 2>&1 && kvm=1
|
|
|
|
;;
|
2012-10-11 16:01:59 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
if [ "$kvm" ]; then
|
|
|
|
# no reason why vhost should not work with TCG, but currently it does not
|
|
|
|
modprobe -b vhost-net >/dev/null 2>&1
|
2012-04-23 08:09:13 +00:00
|
|
|
else
|
2012-10-11 16:01:59 +00:00
|
|
|
exit 0
|
2012-04-23 08:09:13 +00:00
|
|
|
fi
|