diff options
author | John Sonnenschein <johns@joyent.com> | 2011-12-15 00:32:54 +0000 |
---|---|---|
committer | John Sonnenschein <johns@joyent.com> | 2011-12-15 20:31:59 +0000 |
commit | df5fe3d22e102695087d81e2376f4037fc56e13b (patch) | |
tree | 82798a17658195a5935ba3a58ac955012c7ba8a1 /usr/src | |
parent | cc2c87fc55b54602b5879c7ed5c5de0c55f85f27 (diff) | |
download | illumos-joyent-df5fe3d22e102695087d81e2376f4037fc56e13b.tar.gz |
[OS-811] joyent & kvm brands should be able to use device names rather than only tags
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/lib/brand/joyent/zone/statechange.ksh | 8 | ||||
-rwxr-xr-x | usr/src/lib/brand/kvm/zone/statechange.ksh | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/usr/src/lib/brand/joyent/zone/statechange.ksh b/usr/src/lib/brand/joyent/zone/statechange.ksh index 7d7d0213a4..ba4df02b99 100644 --- a/usr/src/lib/brand/joyent/zone/statechange.ksh +++ b/usr/src/lib/brand/joyent/zone/statechange.ksh @@ -142,6 +142,14 @@ setup_net() orig_global=$global_nic global_nic=$(eval echo \$SYSINFO_NIC_${orig_global}) + # If the global nic is specified as a device or etherstub name + # rather than a tag + if [[ -z $global_nic ]]; then + echo "$(dladm show-phys -p -o LINK) $(dladm show-etherstub -p -o LINK)" \ + | egrep "(^| )${orig_global}( |$)" > /dev/null + (( $? == 0 )) && global_nic=${orig_global} + fi + # For backwards compatibility with the other parts of the # system, check if this zone already has this vnic setup. # If so, move on to the next vnic. diff --git a/usr/src/lib/brand/kvm/zone/statechange.ksh b/usr/src/lib/brand/kvm/zone/statechange.ksh index 6efe6f3cb5..7c08ce6ea9 100755 --- a/usr/src/lib/brand/kvm/zone/statechange.ksh +++ b/usr/src/lib/brand/kvm/zone/statechange.ksh @@ -115,6 +115,14 @@ setup_net() orig_global=$global_nic global_nic=$(eval echo \$SYSINFO_NIC_${orig_global}) + # If the global nic is specified as a device or etherstub name + # rather than a tag + if [[ -z $global_nic ]]; then + echo "$(dladm show-phys -p -o LINK) $(dladm show-etherstub -p -o LINK)" \ + | egrep "(^| )${orig_global}( |$)" > /dev/null + (( $? == 0 )) && global_nic=${orig_global} + fi + # For backwards compatibility with the other parts of the # system, check if this zone already has this vnic setup. # If so, move on to the next vnic. |