[pve-devel] [PATCH common] add weave to interfaces

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Jul 13 14:20:53 CEST 2016


On Wed, Jul 13, 2016 at 10:18:57AM +0200, Dominik Csapak wrote:
> this returns a weave interface of type 'weave',
> if it exists in /proc/net/dev
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  src/PVE/INotify.pm | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
> index 7fb3490..3acb436 100644
> --- a/src/PVE/INotify.pm
> +++ b/src/PVE/INotify.pm
> @@ -909,6 +909,8 @@ sub __read_etc_network_interfaces {
>      foreach my $ifname (@$active_ifaces) {
>  	if (my $iface = $ifaces->{$ifname}) {
>  	    $iface->{active} = 1;
> +	} elsif ($ifname =~ m/^weave$/) {
> +	    $ifaces->{weave}->{active} = 1;

Hah! I get that the bottom hunk there sticks to the already existing
style in the if-else chain, but I'd rather use the 'eq' operator in both
cases and replace the /^lo$/ match case with an `($iface eq 'lo')` as
well...

>  	}
>      }
>  
> @@ -986,6 +988,8 @@ sub __read_etc_network_interfaces {
>  	    }
>  	} elsif ($iface =~ m/^lo$/) {
>  	    $d->{type} = 'loopback';
> +	} elsif ($iface =~ m/^weave$/) {
> +	    $d->{type} = 'weave';
>  	} else {
>  	    if (!$d->{ovs_type}) {
>  		$d->{type} = 'unknown';
> -- 
> 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