[pve-devel] [PATCH pve-network 4/7] qinq plugin :add status

Alexandre Derumier aderumier at odiso.com
Mon Feb 10 17:26:07 CET 2020


like vlanplugin, vnets are now virtual
---
 PVE/Network/SDN/Zones/QinQPlugin.pm | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/PVE/Network/SDN/Zones/QinQPlugin.pm b/PVE/Network/SDN/Zones/QinQPlugin.pm
index 08448dc..2023c02 100644
--- a/PVE/Network/SDN/Zones/QinQPlugin.pm
+++ b/PVE/Network/SDN/Zones/QinQPlugin.pm
@@ -56,6 +56,26 @@ sub generate_sdn_config {
     }
 }
 
+sub status {
+    my ($class, $plugin_config, $zone, $id, $vnet, $err_config, $status, $vnet_status, $zone_status) = @_;
+
+    my $bridge = $plugin_config->{bridge};
+    $vnet_status->{$id}->{zone} = $zone;
+    $zone_status->{$zone}->{status} = 'available' if !defined($zone_status->{$zone}->{status});
+
+    if($err_config) {
+	$vnet_status->{$id}->{status} = 'pending';
+	$vnet_status->{$id}->{statusmsg} = $err_config;
+	$zone_status->{$zone}->{status} = 'pending';
+    } elsif ($status->{$bridge}->{status} && $status->{$bridge}->{status} eq 'pass') {
+	$vnet_status->{$id}->{status} = 'available';
+    } else {
+	$vnet_status->{$id}->{status} = 'error';
+	$vnet_status->{$id}->{statusmsg} = 'missing bridge';
+	$zone_status->{$zone}->{status} = 'error';
+    }
+}
+
 1;
 
 
-- 
2.20.1




More information about the pve-devel mailing list