← Back to team overview

netplan-developers team mailing list archive

[Merge] ~ddstreet/netplan/+git/netplan:lp1729573 into netplan:master

 

Dan Streetman has proposed merging ~ddstreet/netplan/+git/netplan:lp1729573 into netplan:master.

Requested reviews:
  Mathieu Trudel-Lapierre (cyphermox)
Related bugs:
  Bug #1729573 in linux (Ubuntu): "netplan breaks Xen VIF driver"
  https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1729573

For more details, see:
https://code.launchpad.net/~ddstreet/netplan/+git/netplan/+merge/333198

Add another interface driver exception to netplan "replug" to prevent unbinding/rebinding of Xen VIF interfaces.

LP: #1729573
-- 
Your team Developers of netplan is subscribed to branch netplan:master.
diff --git a/src/netplan b/src/netplan
index 61eafea..5dca784 100755
--- a/src/netplan
+++ b/src/netplan
@@ -102,6 +102,8 @@ def replug(device):  # pragma: nocover (covered in autopkgtest)
 
     try:
         # we must resolve symlinks here as the device dir will be gone after unbind
+        subsystem = os.path.realpath(os.path.join(devdir, 'device', 'subsystem'))
+        subsystem_name = os.path.basename(subsystem)
         driver = os.path.realpath(os.path.join(devdir, 'device', 'driver'))
         driver_name = os.path.basename(driver)
         if driver_name == 'mac80211_hwsim':
@@ -111,6 +113,10 @@ def replug(device):  # pragma: nocover (covered in autopkgtest)
         if driver_name == 'mwifiex_pcie':
             logging.debug('replug %s: mwifiex_pcie crashes on rebinding, ignoring', device)
             return False
+        # workaround for https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1729573
+        if subsystem_name == 'xen' and driver_name == 'vif':
+            logging.debug('replug %s: xen:vif fails on rebinding, ignoring', device)
+            return False
         # workaround for problem with ath9k_htc module: this driver is async and does not support
         # sequential unbind / rebind, one soon after the other
         if driver_name == 'ath9k_htc':

Follow ups