Bug 785291 - boot speedup: don't execute grep in kvm.modules [PATCH]
Summary: boot speedup: don't execute grep in kvm.modules [PATCH]
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: qemu
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Justin M. Forbes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-27 21:35 UTC by Will Woods
Modified: 2013-01-09 11:58 UTC (History)
18 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-09 20:36:14 UTC
Type: ---


Attachments (Terms of Use)

Description Will Woods 2012-01-27 21:35:39 UTC
/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 20:36:14 UTC
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.