[pve-devel] [PATCH] read|write network interfaces : add support for vlan bridge|interface

Alexandre Derumier aderumier at odiso.com
Tue Sep 22 04:52:12 CEST 2015


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 src/PVE/INotify.pm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
index 22f01d1..61faa70 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -971,6 +971,10 @@ sub __read_etc_network_interfaces {
 	    } else {
 		$d->{type} = 'unknown';
 	    }
+	} elsif ($iface =~ m/^(eth|bond)\d+.\d+$/) {
+		$d->{type} = 'interface_vlan';
+	} elsif ($iface =~ m/^vmbr\d+.\d+$/) {
+		$d->{type} = 'bridge_vlan';
 	} elsif ($iface =~ m/^lo$/) {
 	    $d->{type} = 'loopback';
 	} else {
@@ -1285,7 +1289,9 @@ NETWORKDOC
 	loopback => 100000,
 	eth => 200000,
 	bond => 300000,
+	interface_vlan => 350000,
 	bridge => 400000,
+	bridge_vlan => 500000,
    };
 
     my $lookup_type_prio = sub {
@@ -1306,6 +1312,10 @@ NETWORKDOC
 	    $pri = $if_type_hash->{bond} + $alias;
 	} elsif ($iface =~ m/^vmbr\d+$/) {
 	    $pri = $if_type_hash->{bridge} + $alias;
+	} elsif ($iface =~ m/^vmbr\d+.\d+$/) {
+	    $pri = $if_type_hash->{bridge_vlan} + $alias;
+	} elsif ($iface =~ m/^(eth|bond)\d+.\d+$/) {
+	    $pri = $if_type_hash->{interface_vlan} + $alias;
 	}
 
 	return $pri || ($if_type_hash->{unknown} + $alias);
-- 
2.1.4



More information about the pve-devel mailing list