[Ovirt-devel] [PATCH node] Add support for finding virtio interfaces that may not have been detected by hal

Perry Myers pmyers at redhat.com
Tue Jan 20 21:56:49 UTC 2009


Signed-off-by: Perry Myers <pmyers at redhat.com>
---
 scripts/ovirt-config-networking |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking
index 9ede511..3ad8ee3 100755
--- a/scripts/ovirt-config-networking
+++ b/scripts/ovirt-config-networking
@@ -199,14 +199,17 @@ function configure_dns
 
 function setup_menu
 {
+    NICS=""
     udi_list=$(hal-find-by-capability --capability net.80203)
-    if [ -z "$udi_list" ]; then
-	warn "ERROR: no usable network devices were found"
-	exit 1
+    if [ -n "$udi_list" ]; then
+        for d in $udi_list; do
+            NICS="$NICS $(hal-get-property --udi "$d" --key net.interface)"
+        done
     fi
 
-    NICS=""
-    for d in $udi_list; do NICS="$NICS $(hal-get-property --udi "$d" --key net.interface)"; done
+    # Add virtio NICs that were possibly not detected by hal
+    NICS="$NICS $(ifconfig -a | awk '/Ethernet/ {print $1}' | xargs)"
+    NICS=$(echo $NICS | tr ' ' '\n' | sort -u | xargs)
 
     PS3="Please select an interface or configuration option: "
 }
-- 
1.6.0.6




More information about the ovirt-devel mailing list