[Ovirt-devel] [PATCH node] Checks for hardware support for virtualization.

Darryl L. Pierce dpierce at redhat.com
Thu Feb 26 19:21:40 UTC 2009


NOTE: this patch adds text to the /etc/issue file so that the user
      sees the lack of hardware virt on login.

If hardware support is not found then an error is logged calling out
that hardware virt is not supported.

Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
---
 scripts/ovirt-post |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

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
+    egrep -v "^No hardware virtualization" < $ISSUE > $BACKUP
+    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
-- 
1.6.0.6




More information about the ovirt-devel mailing list