containers: Improve device dependency tracking

Now the tracking works with aggregated devices on aggregated devices.

So container with physical device where the device is put in a bond
which is the basis for a bridge is now handled correctly.
This commit is contained in:
Arnold Krille
2016-09-30 14:52:46 +02:00
parent f0492bd53c
commit cc91f274e0
2 changed files with 86 additions and 19 deletions

View File

@@ -196,7 +196,7 @@ in
createBridgeDevice = n: v: nameValuePair "${n}-netdev"
(let
deps = if config.boot.isContainer then [] else map subsystemDevice v.interfaces;
deps = concatLists (map deviceDependency v.interfaces);
in
{ description = "Bridge Interface ${n}";
wantedBy = [ "network-setup.service" (subsystemDevice n) ];
@@ -237,7 +237,7 @@ in
createVswitchDevice = n: v: nameValuePair "${n}-netdev"
(let
deps = if config.boot.isContainer then [] else map subsystemDevice v.interfaces;
deps = concatLists (map deviceDependency v.interfaces);
ofRules = pkgs.writeText "vswitch-${n}-openFlowRules" v.openFlowRules;
in
{ description = "Open vSwitch Interface ${n}";
@@ -270,7 +270,7 @@ in
createBondDevice = n: v: nameValuePair "${n}-netdev"
(let
deps = if config.boot.isContainer then [] else map subsystemDevice v.interfaces;
deps = concatLists (map deviceDependency v.interfaces);
in
{ description = "Bond Interface ${n}";
wantedBy = [ "network-setup.service" (subsystemDevice n) ];