public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH common] Fix #2711: inotify: Allow 'v' as VLAN separator
@ 2021-04-14  9:53 Dominic Jäger
  2021-04-14  9:53 ` [pve-devel] [PATCH widget-toolkit] Fix #2711: vlan edit: " Dominic Jäger
  2021-04-14 11:26 ` [pve-devel] [PATCH common] Fix #2711: inotify: " Fabian Grünbichler
  0 siblings, 2 replies; 3+ messages in thread
From: Dominic Jäger @ 2021-04-14  9:53 UTC (permalink / raw)
  To: pve-devel

VLANs with a name like vmbr0v5 had type UNKNOWN unless vlan-raw-device was set.
This way we return type VLAN for them as we do for vmbr0.5

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
---
 src/PVE/INotify.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
index 2bb87bb..adcc91a 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -27,6 +27,8 @@ use base 'Exporter';
 
 our @EXPORT_OK = qw(read_file write_file register_file);
 
+my $VLAN_RE = qr!^(\S+)[v\.](\d+)$!;
+
 my $ccache;
 my $ccachemap;
 my $ccacheregex;
@@ -1077,7 +1079,7 @@ sub __read_etc_network_interfaces {
 		$ifaces->{$1}->{exists} = 0;
 		$d->{exists} = 0;
 	    }
-	} elsif ($iface =~ m/^(\S+)\.\d+$/ || $d->{'vlan-raw-device'}) {
+	} elsif ($iface =~ $VLAN_RE || $d->{'vlan-raw-device'}) {
 	    $d->{type} = 'vlan';
 
 	    my $raw_iface = $d->{'vlan-raw-device'} ? $d->{'vlan-raw-device'} : $1;
@@ -1550,7 +1552,7 @@ sub __write_etc_network_interfaces {
 	    my $p = undef;
 	    my $vlanid = undef;
 
-	    if ($iface =~ m/^(\S+)\.(\d+)$/) {
+	    if ($iface =~ $VLAN_RE) {
 		$p = $1;
 		$vlanid = $2;
 		delete $d->{'vlan-raw-device'} if $d->{'vlan-raw-device'};
-- 
2.20.1




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] [PATCH widget-toolkit] Fix #2711: vlan edit: Allow 'v' as VLAN separator
  2021-04-14  9:53 [pve-devel] [PATCH common] Fix #2711: inotify: Allow 'v' as VLAN separator Dominic Jäger
@ 2021-04-14  9:53 ` Dominic Jäger
  2021-04-14 11:26 ` [pve-devel] [PATCH common] Fix #2711: inotify: " Fabian Grünbichler
  1 sibling, 0 replies; 3+ messages in thread
From: Dominic Jäger @ 2021-04-14  9:53 UTC (permalink / raw)
  To: pve-devel

Set the VLAN raw device and VLAN ID fields in the GUI correctly when
VLANs are specified with 'v' instead of a dot, vmbr0v5 for example.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
---
 src/Utils.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Utils.js b/src/Utils.js
index 3fd8f91..2d58ad9 100644
--- a/src/Utils.js
+++ b/src/Utils.js
@@ -1046,7 +1046,7 @@ utilities: {
 	me.HostPortBrackets_match = new RegExp("^\\[(" + IPV6_REGEXP + "|" + IPV4_REGEXP + "|" + DnsName_REGEXP + ")\\](?::(\\d+))?$");
 	me.IP6_dotnotation_match = new RegExp("^(" + IPV6_REGEXP + ")(?:\\.(\\d+))?$");
 	me.Vlan_match = /^vlan(\d+)/;
-	me.VlanInterface_match = /(\w+)\.(\d+)/;
+	me.VlanInterface_match = /(\w+)[v.](\d+)/;
     },
 });
 
-- 
2.20.1




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH common] Fix #2711: inotify: Allow 'v' as VLAN separator
  2021-04-14  9:53 [pve-devel] [PATCH common] Fix #2711: inotify: Allow 'v' as VLAN separator Dominic Jäger
  2021-04-14  9:53 ` [pve-devel] [PATCH widget-toolkit] Fix #2711: vlan edit: " Dominic Jäger
@ 2021-04-14 11:26 ` Fabian Grünbichler
  1 sibling, 0 replies; 3+ messages in thread
From: Fabian Grünbichler @ 2021-04-14 11:26 UTC (permalink / raw)
  To: Proxmox VE development discussion

On April 14, 2021 11:53 am, Dominic Jäger wrote:
> VLANs with a name like vmbr0v5 had type UNKNOWN unless vlan-raw-device was set.
> This way we return type VLAN for them as we do for vmbr0.5

as indicated in the corresponding bug - vmbr0v5 is not a VLAN device, 
but a bridge with a VLAN device as port. this patch is thus going in the 
wrong direction ;)

> 
> Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
> ---
>  src/PVE/INotify.pm | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
> index 2bb87bb..adcc91a 100644
> --- a/src/PVE/INotify.pm
> +++ b/src/PVE/INotify.pm
> @@ -27,6 +27,8 @@ use base 'Exporter';
>  
>  our @EXPORT_OK = qw(read_file write_file register_file);
>  
> +my $VLAN_RE = qr!^(\S+)[v\.](\d+)$!;
> +
>  my $ccache;
>  my $ccachemap;
>  my $ccacheregex;
> @@ -1077,7 +1079,7 @@ sub __read_etc_network_interfaces {
>  		$ifaces->{$1}->{exists} = 0;
>  		$d->{exists} = 0;
>  	    }
> -	} elsif ($iface =~ m/^(\S+)\.\d+$/ || $d->{'vlan-raw-device'}) {
> +	} elsif ($iface =~ $VLAN_RE || $d->{'vlan-raw-device'}) {
>  	    $d->{type} = 'vlan';
>  
>  	    my $raw_iface = $d->{'vlan-raw-device'} ? $d->{'vlan-raw-device'} : $1;
> @@ -1550,7 +1552,7 @@ sub __write_etc_network_interfaces {
>  	    my $p = undef;
>  	    my $vlanid = undef;
>  
> -	    if ($iface =~ m/^(\S+)\.(\d+)$/) {
> +	    if ($iface =~ $VLAN_RE) {
>  		$p = $1;
>  		$vlanid = $2;
>  		delete $d->{'vlan-raw-device'} if $d->{'vlan-raw-device'};
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-14 11:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-14  9:53 [pve-devel] [PATCH common] Fix #2711: inotify: Allow 'v' as VLAN separator Dominic Jäger
2021-04-14  9:53 ` [pve-devel] [PATCH widget-toolkit] Fix #2711: vlan edit: " Dominic Jäger
2021-04-14 11:26 ` [pve-devel] [PATCH common] Fix #2711: inotify: " Fabian Grünbichler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal