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

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Jun 5 11:25:47 CEST 2019


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




More information about the pve-devel mailing list