summary refs log tree commit diff
diff options
context:
space:
mode:
authorThomas Strobel <ts468@cam.ac.uk>2015-10-05 13:23:58 +0200
committerThomas Strobel <ts468@cam.ac.uk>2015-10-06 20:12:39 +0200
commit881ec1efb840dd1c62b89588d67f6e2822791759 (patch)
tree0d87b9b7a4310e5573d21e632e00dfedbf951a58
parent7a8980193d94a15bf4d7267d846e5b69c61fa413 (diff)
downloadnixlib-881ec1efb840dd1c62b89588d67f6e2822791759.tar
nixlib-881ec1efb840dd1c62b89588d67f6e2822791759.tar.gz
nixlib-881ec1efb840dd1c62b89588d67f6e2822791759.tar.bz2
nixlib-881ec1efb840dd1c62b89588d67f6e2822791759.tar.lz
nixlib-881ec1efb840dd1c62b89588d67f6e2822791759.tar.xz
nixlib-881ec1efb840dd1c62b89588d67f6e2822791759.tar.zst
nixlib-881ec1efb840dd1c62b89588d67f6e2822791759.zip
networking module: vswitches: re-structure dependencies to systemd units
-rw-r--r--nixos/modules/tasks/network-interfaces-scripted.nix14
-rw-r--r--nixos/modules/tasks/network-interfaces.nix14
2 files changed, 6 insertions, 22 deletions
diff --git a/nixos/modules/tasks/network-interfaces-scripted.nix b/nixos/modules/tasks/network-interfaces-scripted.nix
index d8b1592c36bb..80b7f718580e 100644
--- a/nixos/modules/tasks/network-interfaces-scripted.nix
+++ b/nixos/modules/tasks/network-interfaces-scripted.nix
@@ -222,21 +222,15 @@ in
 
         createVswitchDevice = n: v: nameValuePair "${n}-netdev"
           (let
-            managedInterfaces = filter (x: hasAttr x cfg.interfaces) v.interfaces;
-            managedInterfaceServices = concatMap (i: [ "network-addresses-${i}.service" "network-link-${i}.service" ]) managedInterfaces;
-            virtualInterfaces = filter (x: (hasAttr x cfg.interfaces) && cfg.interfaces.${x}.virtual) v.interfaces;
-            virtualInterfaceServices = concatMap (i: [ "${i}-netdev.service" ]) virtualInterfaces;
             deps = map subsystemDevice v.interfaces;
             ofRules = pkgs.writeText "vswitch-${n}-openFlowRules" v.openFlowRules;
           in
           { description = "Open vSwitch Interface ${n}";
-            wantedBy = [ "network.target" "vswitchd.service" (subsystemDevice n) ];
-            requires = optionals v.bindInterfaces (deps ++ managedInterfaceServices ++ virtualInterfaceServices);
-            requiredBy = optionals v.bindInterfaces (managedInterfaceServices ++ virtualInterfaceServices);
-            bindsTo = deps ++ [ "vswitchd.service" ];
+            wantedBy = [ "network.target" "vswitchd.service" ] ++ deps;
+            bindsTo =  [ "vswitchd.service" (subsystemDevice n) ] ++ deps;
             partOf = [ "vswitchd.service" ];
-            after = [ "network-pre.target" "vswitchd.service" ] ++ deps ++ managedInterfaceServices ++ virtualInterfaceServices;
-            before = [ "network-interfaces.target" (subsystemDevice n) ];
+            after = [ "network-pre.target" "vswitchd.service" ] ++ deps;
+            before = [ "network-interfaces.target" ];
             serviceConfig.Type = "oneshot";
             serviceConfig.RemainAfterExit = true;
             path = [ pkgs.iproute config.virtualisation.vswitch.package ];
diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix
index 6b5241c2aa59..92151b00b06b 100644
--- a/nixos/modules/tasks/network-interfaces.nix
+++ b/nixos/modules/tasks/network-interfaces.nix
@@ -381,8 +381,8 @@ in
       description =
         ''
           This option allows you to define Open vSwitches that connect
-          physical networks together.  The value of this option is an
-          attribute set.  Each attribute specifies a vswitch, with the
+          physical networks together. The value of this option is an
+          attribute set. Each attribute specifies a vswitch, with the
           attribute name specifying the name of the vswitch's network
           interface.
         '';
@@ -398,16 +398,6 @@ in
             "The physical network interfaces connected by the vSwitch.";
         };
 
-        bindInterfaces = mkOption {
-          type = types.bool;
-          default = false;
-          description = ''
-            If true, then the interfaces of the vSwitch are brought 'up' and especially
-            also 'down' together with the vSwitch. That requires that every interfaces
-            is configured as a systemd network services.
-          '';
-        };
-
         controllers = mkOption {
           type = types.listOf types.str;
           default = [];