|
Glauber Costa |
b8bea8 |
#!/bin/sh
|
|
Glauber Costa |
b8bea8 |
|
|
Paolo Bonzini |
2803fc |
case $(uname -m) in
|
|
Paolo Bonzini |
2803fc |
i?86|x86_64)
|
|
Paolo Bonzini |
2803fc |
grep vmx /proc/cpuinfo >/dev/null 2>&1 && vmx=1
|
|
Paolo Bonzini |
2803fc |
grep svm /proc/cpuinfo >/dev/null 2>&1 && svm=1
|
|
Glauber Costa |
b8bea8 |
|
|
Paolo Bonzini |
2803fc |
if [ "$vmx" ] || [ "$svm" ]; then
|
|
Paolo Bonzini |
31c633 |
[ "$vmx" ] && modprobe -b kvm-intel >/dev/null 2>&1 && kvm=1
|
|
Paolo Bonzini |
31c633 |
[ "$svm" ] && modprobe -b kvm-amd >/dev/null 2>&1 && kvm=1
|
|
Paolo Bonzini |
2803fc |
fi
|
|
Paolo Bonzini |
2803fc |
;;
|
|
Paolo Bonzini |
2803fc |
ppc64)
|
|
Paolo Bonzini |
2803fc |
grep OPAL /proc/cpuinfo >/dev/null 2>&1 && opal=1
|
|
Paolo Bonzini |
2803fc |
|
|
Paolo Bonzini |
2803fc |
if [ "$opal" ]; then
|
|
Paolo Bonzini |
31c633 |
modprobe -b kvm >/dev/null 2>&1 && kvm=1
|
|
Paolo Bonzini |
2803fc |
fi
|
|
Paolo Bonzini |
2803fc |
;;
|
|
Paolo Bonzini |
31c633 |
s390x)
|
|
Paolo Bonzini |
31c633 |
modprobe -b kvm >/dev/null 2>&1 && kvm=1
|
|
Paolo Bonzini |
31c633 |
;;
|
|
Paolo Bonzini |
2803fc |
esac
|
|
Paolo Bonzini |
2803fc |
|
|
Paolo Bonzini |
2803fc |
if [ "$kvm" ]; then
|
|
Paolo Bonzini |
2803fc |
# no reason why vhost should not work with TCG, but currently it does not
|
|
Paolo Bonzini |
2803fc |
modprobe -b vhost-net >/dev/null 2>&1
|
|
Paolo Bonzini |
34104a |
else
|
|
Paolo Bonzini |
2803fc |
exit 0
|
|
Paolo Bonzini |
34104a |
fi
|