]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/INotify.pm
Inotify : add check_bond
[pve-common.git] / src / PVE / INotify.pm
index 186df62ddfb140e00fa278234a756968d9cbe503..f4a594571a49bfef69c4344bbcb0b2104919e70a 100644 (file)
@@ -1319,6 +1319,21 @@ sub __write_etc_network_interfaces {
        }
     }
 
+    # check bond
+    foreach my $iface (keys %$ifaces) {
+       my $d = $ifaces->{$iface};
+       if ($d->{type} eq 'bond' && $d->{slaves}) {
+           foreach my $p (split (/\s+/, $d->{slaves})) {
+               my $n = $ifaces->{$p};
+
+               die "bond '$iface' - unable to find slave '$p'\n"
+                   if !$n;
+               die "bond '$iface' - wrong interface type on slave '$p' " .
+                   "('$n->{type}' != 'eth')\n" if $n->{type} ne 'eth';
+           }
+       }
+    }
+
     # check vxlan
     my $vxlans = {};
     foreach my $iface (keys %$ifaces) {