[Ovirt-devel] [PATCH node] Checks for hardware support for virtualization.
Darryl L. Pierce
dpierce at redhat.com
Thu Feb 26 19:43:00 UTC 2009
On Thu, Feb 26, 2009 at 02:28:36PM -0500, Perry Myers wrote:
>> diff --git a/scripts/ovirt-post b/scripts/ovirt-post
>> index 068c709..8409e5d 100755
>> --- a/scripts/ovirt-post
>> +++ b/scripts/ovirt-post
>> @@ -11,6 +11,21 @@
>> . /etc/init.d/ovirt-functions
>> start() {
>> + BACKUP=$(mktemp)
>> + ISSUE=/etc/issue
>
> declare local since they're only used in this function?
Okay.
>> + egrep -v "^No hardware virtualization" < $ISSUE > $BACKUP
>
> egrep -v ".." $ISSUE should work, what is the < for?
Habit with redirection.
>> + cp -f $BACKUP $ISSUE
>> + hwvirt=$(virsh capabilities)
>> + if [[ $hwvirt =~ kvm ]]; then
>> + log "Hardware virtualization detected"
>> + else
>> + log "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
>> + log "!!! No hardware virtualization detected. !!!"
>> + log "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
>> +
>> + echo "No hardware virtualization was detected." >> $ISSUE
>> + fi
>> +
>> if is_standalone; then
>> return 0
>> fi
>
> Also, we should do the same for /etc/issue.net too right? I think that
> is used for ssh and /etc/issue is for serial/local console. Or maybe
> issue.net is only for telnet... I forget. And we might want to make the
> error in /etc/issue* stand out more.
>
> Hmm, we could also be nicer and detect:
> 1. hardware virt present on chip and enabled (virsh capabilities succeeds)
> 2. hardware virt present on chip but disabled in bios (virsh capabilities
> fails, but check for flag in /proc/cpuinfo succeeds)
> 3. hardware virt not present on chip (virsh capabilities and cpuinfo
> check failed)
>
> That way the user could differentiate between:
> 1. I need new hardware
> 2. whoops, need to fix my Bios
I like how that sounds. I'll readdress the patch and send an update
shortly.
--
Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc.
Virtual Machine Management - http://www.ovirt.org/
Is fearr Gaeilge bhriste ná Béarla cliste.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20090226/34ce98ae/attachment.sig>
More information about the ovirt-devel
mailing list