31 lines
1.2 KiB
Diff
31 lines
1.2 KiB
Diff
commit e25d71be411b610e5e889f8efaaf04b38c2d9ecb
|
|
Author: Mingming Cao <mmc@linux.vnet.ibm.com>
|
|
Date: Fri Mar 12 13:50:33 2021 -0800
|
|
|
|
hcnmgr: Avoid using ifcfg file for checking bonding interface status
|
|
|
|
When configuring migratable sr_iov into hybrid network, it checks if
|
|
there is an existing HNV using the presense of ifcfg file location. This
|
|
is not preferred as the location can be different on distros.
|
|
|
|
This patch fixes this by using NetworkManager nmcli.
|
|
|
|
Signed-off-by: Mingming Cao <mmc@linux.vnet.ibm.com>
|
|
[tyreld: fixed spelling]
|
|
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
|
|
|
|
diff --git a/scripts/hcnmgr b/scripts/hcnmgr
|
|
index 0d20e7d..d66b5d1 100644
|
|
--- a/scripts/hcnmgr
|
|
+++ b/scripts/hcnmgr
|
|
@@ -282,8 +282,7 @@ do_config_vdevice() {
|
|
|
|
hcnlog DEBUG "Check if there is bond $BONDNAME with hcn id $HCNID"
|
|
|
|
- hcnlog DEBUG "ifconfig file $IFCONFIG_PATH/ifconfig-$BONDNAME"
|
|
- if [ ! -e "$IFCONFIG_PATH/ifcfg-$BONDNAME" ]; then
|
|
+ if ! nmcli -f NAME con show --active | grep -q "$BONDNAME\s"; then
|
|
hcnlog INFO "nmcli con add type bond con-name $BONDNAME ifname $BONDNAME"
|
|
nmcli con add type bond con-name "$BONDNAME" ifname "$BONDNAME"
|
|
|