tools/hotplug/Linux: remove code duplication in vif-bridge
authorPaul Durrant <pdurrant@amazon.com>
Tue, 11 Aug 2020 08:01:58 +0000 (09:01 +0100)
committerWei Liu <wl@xen.org>
Thu, 27 Aug 2020 10:04:14 +0000 (10:04 +0000)
The 'add' and 'online' cases do exactly the same thing so have 'add' simply
fall through to 'online'.

NOTE: This patch also adds in the missing 'remove' case, which falls though
      to 'offline'. (The former is passed for 'tap' devices, the latter for
      'vif' devices).

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Acked-by: Wei Liu <wl@xen.org>
tools/hotplug/Linux/vif-bridge

index c3e409926d4caf4f6cc61babd018db8024e67e30..e1d7c49788d53f48b3b07c08d311bd2be18409dc 100644 (file)
@@ -77,21 +77,18 @@ then
 fi
 
 case "$command" in
+    add)
+        ;&
     online)
         setup_virtual_bridge_port "$dev"
         set_mtu "$bridge" "$dev"
         add_to_bridge "$bridge" "$dev"
         ;;
-
+    remove)
+        ;&
     offline)
         remove_from_bridge "$bridge" "$dev"
         ;;
-
-    add)
-        setup_virtual_bridge_port "$dev"
-        set_mtu "$bridge" "$dev"
-        add_to_bridge "$bridge" "$dev"
-        ;;
 esac
 
 handle_iptable