boot speedup optimization with kvm.modules BZ#785291

This commit is contained in:
Justin M. Forbes 2012-02-09 14:35:05 -06:00
parent 261b9ddbcd
commit e7a45f871f
1 changed files with 7 additions and 8 deletions

View File

@ -1,11 +1,10 @@
#!/bin/sh
if [ $(grep -c vmx /proc/cpuinfo) -ne 0 ]; then
modprobe -b kvm-intel >/dev/null 2>&1
modprobe -b vhost-net >/dev/null 2>&1
fi
case "$(</proc/cpuinfo)" in
*vmx*) vmx=1 ;;
*svm*) svm=1 ;;
esac
if [ $(grep -c svm /proc/cpuinfo) -ne 0 ]; then
modprobe -b kvm-amd >/dev/null 2>&1
modprobe -b vhost-net >/dev/null 2>&1
fi
[ "$vmx" ] && modprobe -b kvm-intel >/dev/null 2>&1
[ "$svm" ] && modprobe -b kvm-amd >/dev/null 2>&1
[ "$vmx" -o "$svm" ] && modprobe -b vhost-net >/dev/null 2>&1