[pve-devel] [PATCH V2 pve-common 1/2] INotify: use auto for ovs interfaces with ifupdown2

Alexandre Derumier aderumier at odiso.com
Fri Feb 21 10:28:11 CET 2020


Need the ifupdown2 openvswitch addon !
---
 src/PVE/INotify.pm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
index ba952e3..55ff969 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -1320,7 +1320,12 @@ sub __interface_to_string {
 	$done->{ovs_type} = 1;
 
 	if (my $bridge = $d->{ovs_bridge}) {
-	    $raw = "allow-$bridge $iface\n$raw";
+	    if ($ifupdown2) {
+		$raw = "auto $iface\n$raw";
+	    } else {
+		$raw = "allow-$bridge $iface\n$raw";
+	    }
+
 	    $raw .= "\tovs_bridge $bridge\n";
 	    $done->{ovs_bridge} = 1;
 	}
@@ -1662,7 +1667,7 @@ NETWORKDOC
 
 	$printed->{$iface} = 1;
 	if ($d->{autostart}) {
-	    if ($d->{type} eq 'OVSBridge') {
+	    if ($d->{type} eq 'OVSBridge' && !$ifupdown2) {
 		# cannot use 'auto' for OVS, would add race with systemd ifup at .service
 		$raw .= "allow-ovs $iface\n";
 	    } else {
-- 
2.20.1



More information about the pve-devel mailing list