[pve-devel] [RFC PATCH 5/7] merge bridge_port declarations
Wolfgang Bumiller
w.bumiller at proxmox.com
Mon Jun 22 16:06:58 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 c825a11..bc6c345 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -853,7 +853,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';
@@ -1008,8 +1012,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