[Ovirt-devel] [PATCH node] Changes how macs are collected by ovirt-early.

Darryl L. Pierce dpierce at redhat.com
Mon Mar 30 19:35:29 UTC 2009


Instead of checking for those devices that are currently active, it
instead uses the list of network devices reported by hal. Specifically,
those devices that support the net.80203 capability.

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

diff --git a/scripts/ovirt-early b/scripts/ovirt-early
index 9ab2981..d4278a2 100755
--- a/scripts/ovirt-early
+++ b/scripts/ovirt-early
@@ -14,8 +14,14 @@ BONDING_MODCONF_FILE=/etc/modprobe.d/bonding
 AUGTOOL_CONFIG=/var/tmp/augtool-config
 
 get_mac_addresses() {
-    macs=$(ifconfig | awk '/HWaddr/ { print $5"="$1 }' \
-                    | tr '\n' ' ' | sed 's/ /%2C/g;s/:/%3A/g')
+    macs=""
+    devices=$(hal-find-by-capability --capability net.80203)
+    for device in $devices; do
+	mac=$(hal-get-property --udi $device --key net.address)
+	iface=$(hal-get-property --udi $device --key net.interface)
+	macs="${macs}${mac}=${iface} "
+    done
+    macs=$(echo $macs | sed 's/ /%2C/g;s/:/%3A/g;s/=/%3D/g')
 }
 
 configure_from_network() {
-- 
1.6.0.6




More information about the ovirt-devel mailing list