[pve-devel] [PATCH 05/16] merge bridge_port declarations

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Jun 24 14:33:19 CEST 2015


---
 src/PVE/INotify.pm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
index 5bae210..4dde7b0 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -854,7 +854,11 @@ sub read_etc_network_interfaces {
 			    $devs->{$p} = 1;
 			}
 			my $str = join (' ', sort keys %{$devs});
-			$d->{$id} = $str || '';
+			if ($d->{$id}) {
+			    $d->{$id} .= "\n" . $str if $str;
+			} else {
+			    $d->{$id} = $str || '';
+			}
 		    } elsif ($id eq 'bridge_stp') {
 			if ($value =~ m/^\s*(on|yes)\s*$/i) {
 			    $d->{$id} = 'on';
@@ -1009,8 +1013,8 @@ sub __interface_to_string {
  
     if ($d->{type} eq 'bridge') {
 
-	my $ports = $d->{bridge_ports} || 'none';
-	$raw .= "\tbridge_ports $ports\n";
+	my @ports = split(/\n/, $d->{bridge_ports} || 'none');
+	$raw .= "\tbridge_ports $_\n" foreach @ports;
 	$done->{bridge_ports} = 1;
 
 	my $v = defined($d->{bridge_stp}) ? $d->{bridge_stp} : 'off';
-- 
2.1.4





More information about the pve-devel mailing list