Red Hat Bugzilla – Bug 785291
boot speedup: don't execute grep in kvm.modules [PATCH]
Last modified: 2013-01-09 06:58:26 EST
/etc/sysconfig/modules/kvm.modules runs 'grep' twice to see if the CPU supports VMX or SVM. This can be handled without calling out to external programs, like so:
case "$(</proc/cpuinfo)" in
*vmx*) vmx=1 ;;
*svm*) svm=1 ;;
[ "$vmx" ] && modprobe -b kvm-intel >/dev/null 2>&1
[ "$svm" ] && modprobe -b kvm-amd >/dev/null 2>&1
[ "$vmx" -o "$svm" ] && modprobe -b virtio-net >/dev/null 2>&1
Sure, it's minor, but it's faster and functionally equivalent. Can't hurt, right?
Thanks, it might be minor, but it is appreciated. This will make the next releases.