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

Alexandre DERUMIER aderumier at odiso.com
Tue Sep 22 07:51:10 CEST 2015


>>Doesn't affect functionality, but curious if there's a reason these weren't added in the same order both times... 

No special reason ;)


I'll try to improved the patch today, to manage vlan as we manage the alias.
(Dietmar please don't commit them)


----- Mail original -----
De: "Daniel Hunsaker" <danhunsaker at gmail.com>
À: "aderumier" <aderumier at odiso.com>, "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Mardi 22 Septembre 2015 05:21:39
Objet: Re: [pve-devel] [PATCH] read|write network interfaces : add support for vlan bridge|interface



Doesn't affect functionality, but curious if there's a reason these weren't added in the same order both times... 
On Mon, Sep 21, 2015, 20:52 Alexandre Derumier < aderumier at odiso.com > wrote: 


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 

_______________________________________________ 
pve-devel mailing list 
pve-devel at pve.proxmox.com 
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 






More information about the pve-devel mailing list