Bug 785291 - boot speedup: don't execute grep in kvm.modules [PATCH]
boot speedup: don't execute grep in kvm.modules [PATCH]
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: qemu (Show other bugs)
16
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Justin M. Forbes
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-27 16:35 EST by Will Woods
Modified: 2013-01-09 06:58 EST (History)
18 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-02-09 15:36:14 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Will Woods 2012-01-27 16:35:39 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:

#!/bin/bash

case "$(</proc/cpuinfo)" in
    *vmx*) vmx=1 ;;
    *svm*) svm=1 ;;
esac

[ "$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?
Comment 1 Justin M. Forbes 2012-02-09 15:36:14 EST
Thanks, it might be minor, but it is appreciated.  This will make the next releases.

Note You need to log in before you can comment on or make changes to this bug.