[pve-devel] [PATCH common 1/1] Fix #545: Allow descriptive names for network bridges and bonds

Alexandre DERUMIER aderumier at odiso.com
Thu Jun 6 07:54:21 CEST 2019


Hi,

I think the main problem could be the 16 characters limit.

ifupdown2 already support "alias" option on interfaces

auto eth0
iface eth0
    alias "my super long string of description"


which is doing:

#ip link set dev eth0 alias "my super long string of description"


and you can see description with 
#ip link


I was planning to use that for vnet too. (keeping vnet(\d+) as interface id, and add a custom description).

We could add easily a ifup script for ifupdown1.


What do you think about this ?



----- Mail original -----
De: "Fabian Grünbichler" <f.gruenbichler at proxmox.com>
À: "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Mercredi 5 Juin 2019 11:25:47
Objet: Re: [pve-devel] [PATCH common 1/1] Fix #545: Allow descriptive names for network bridges and bonds

On Wed, May 15, 2019 at 11:49:30AM +0200, Dominic Jäger wrote: 
> Allowing more descriptive names for network bridges and bonds makes 
> their identification easier. 

there are probably a few more places where this would need to be 
adjusted: 

/usr/share/perl5/PVE/FirewallSimulator.pm:395: } elsif ($route_state =~ m/^vmbr\d+$/) { 
/usr/share/perl5/PVE/FirewallSimulator.pm:529: } elsif ($from =~ m|^(vmbr\d+)/(\S+)$|) { 
/usr/share/perl5/PVE/FirewallSimulator.pm:567: } elsif ($to =~ m|^(vmbr\d+)/(\S+)$|) { 
/usr/share/perl5/PVE/QemuServer.pm:5914: bridge => "vmbr$ind", 
/usr/share/perl5/PVE/Service/pve_firewall.pm:287: pattern => '(host|outside|vm\d+|ct\d+|vmbr\d+/\S+)', 
/usr/share/perl5/PVE/Service/pve_firewall.pm:294: pattern => '(host|outside|vm\d+|ct\d+|vmbr\d+/\S+)', 
/usr/share/perl5/PVE/Network.pm:498: PVE::Tools::dir_glob_foreach($dir, '(((eth|bond)\d+|en[^.]+)(\.\d+)?)', sub { 

as well as the GUI part. 

per our discussion, maybe this + labels/comments on interfaces could 
get a v2? ;) 

> Signed-off-by: Dominic Jäger <d.jaeger at proxmox.com> 
> --- 
> src/PVE/INotify.pm | 4 ++-- 
> 1 file changed, 2 insertions(+), 2 deletions(-) 
> 
> diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm 
> index b660041..75e5010 100644 
> --- a/src/PVE/INotify.pm 
> +++ b/src/PVE/INotify.pm 
> @@ -1027,7 +1027,7 @@ sub __read_etc_network_interfaces { 
> 
> foreach my $iface (keys %$ifaces) { 
> my $d = $ifaces->{$iface}; 
> - if ($iface =~ m/^bond\d+$/) { 
> + if ($iface =~ m/^bond\w+$/) { 
> if (!$d->{ovs_type}) { 
> $d->{type} = 'bond'; 
> } elsif ($d->{ovs_type} eq 'OVSBond') { 
> @@ -1049,7 +1049,7 @@ sub __read_etc_network_interfaces { 
> } else { 
> $d->{type} = 'unknown'; 
> } 
> - } elsif ($iface =~ m/^vmbr\d+$/) { 
> + } elsif ($iface =~ m/^vmbr\w+$/) { 
> if (!$d->{ovs_type}) { 
> $d->{type} = 'bridge'; 
> 
> -- 
> 2.11.0 
> 
> _______________________________________________ 
> pve-devel mailing list 
> pve-devel at pve.proxmox.com 
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 

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




More information about the pve-devel mailing list