[pve-devel] [PATCH pve-common] etc_network_interfaces : handle autostart for ovs
Alexandre Derumier
aderumier at odiso.com
Fri Sep 20 16:29:53 CEST 2019
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
src/PVE/INotify.pm | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
index 65b2d91..e224f78 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -902,8 +902,8 @@ sub __read_etc_network_interfaces {
chomp ($line);
next if $line =~ m/^\s*#/;
- if ($line =~ m/^\s*auto\s+(.*)$/) {
- my @aa = split (/\s+/, $1);
+ if ($line =~ m/^\s*(auto|allow-ovs)\s+(.*)$/) {
+ my @aa = split (/\s+/, $2);
foreach my $a (@aa) {
$ifaces->{$a}->{autostart} = 1;
@@ -1599,11 +1599,13 @@ NETWORKDOC
}
$printed->{$iface} = 1;
- if ($d->{type} eq 'OVSBridge') {
- # cannot use 'auto' for OVS, would add race with systemd ifup at .service
- $raw .= "allow-ovs $iface\n";
- } elsif ($d->{autostart}) {
- $raw .= "auto $iface\n";
+ if ($d->{autostart}) {
+ if ($d->{type} eq 'OVSBridge') {
+ # cannot use 'auto' for OVS, would add race with systemd ifup at .service
+ $raw .= "allow-ovs $iface\n";
+ } else {
+ $raw .= "auto $iface\n";
+ }
}
my $i = 0; # some options should be printed only once
--
2.20.1
More information about the pve-devel
mailing list