[Ovirt-devel] [PATCH node] Fix o-c-networking to only show physical networking devices.

Darryl L. Pierce dpierce at redhat.com
Wed Jan 7 21:50:03 UTC 2009


Only those devices which have a physical layer are presented for
configuration.

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

diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking
index 6609d0a..c322868 100755
--- a/scripts/ovirt-config-networking
+++ b/scripts/ovirt-config-networking
@@ -153,7 +153,16 @@ function configure_interface
 
 function setup_menu
 {
-    NICS=$(hal-device | awk '/net.interface/ {match($0, "= '"'"'(.*)'"'"' ", nic); printf("%s ", nic[1]); }')
+    udi_list=$(hal-device | awk '/net.interface/ {match($0, "= '"'"'(.*)'"'"' ", nic); printf("%s ", nic[1]); }')
+    udi_list=$(hal-find-by-capability --capability net.80203 && hal-find-by-capability --capability net.80211)
+    if [ -z "$udi_list" ]; then
+	warn "ERROR: no usable network devices were found"
+	exit 1
+    fi
+
+    NICS=""
+    for d in $udi_list; do NICS="$NICS $(hal-get-property --udi "$d" --key net.interface)"; done
+
     NICS="$NICS Save Quit"
     PS3="Please select a network interface to configure: "
 }
-- 
1.6.0.6




More information about the ovirt-devel mailing list