]> git.proxmox.com Git - pve-network.git/commitdiff
add on_update_hook
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 4 Apr 2019 08:18:35 +0000 (10:18 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 4 Apr 2019 09:12:44 +0000 (11:12 +0200)
do nothing for now

PVE/API2/Network/Network.pm
PVE/Network/Network/Plugin.pm
PVE/Network/Network/VlanPlugin.pm
PVE/Network/Network/VnetPlugin.pm
PVE/Network/Network/VxlanMulticastPlugin.pm

index a647edf40725f57877e5595e77b1a0c660399c26..7a8b29984510a625016a91070ce78d6fc763e064 100644 (file)
@@ -136,9 +136,7 @@ __PACKAGE__->register_method ({
                }
 
                $cfg->{ids}->{$networkid} = $opts;
-
-               #improveme:
-               #check local configuration of all nodes for conflict
+               $plugin->on_update_hook($networkid, $scfg);
 
                PVE::Network::Network::write_config($cfg);
            
@@ -179,9 +177,9 @@ __PACKAGE__->register_method ({
            foreach my $k (%$opts) {
                $scfg->{$k} = $opts->{$k};
            }
-           #improveme:
-            #add vlan/vxlan check on existingvnets
-           #check local configuration of all nodes for conflict
+
+           $plugin->on_update_hook($networkid, $scfg);
+
            PVE::Network::Network::write_config($cfg);
 
            }, "update network object failed");
index b537535c8713b06b9834c428355833722c982251..e834434a3a1acd7d4febe178704cf6f45625d143 100644 (file)
@@ -58,6 +58,12 @@ sub on_delete_hook {
     # do nothing by default
 }
 
+sub on_update_hook {
+    my ($class, $networkid, $scfg) = @_;
+
+    # do nothing by default
+}
+
 #helpers
 sub parse_tag_number_or_range {
     my ($str, $max, $tag) = @_;
index c335764de9c2034eedb0e9eaf3a7fc8a74ac8a32..a2c029272fd3a7214303e2217cfed157cfd8076c 100644 (file)
@@ -102,6 +102,14 @@ sub on_delete_hook {
     # verify that no vnet are associated to this transport  
 }
 
+sub on_update_hook {
+    my ($class, $networkid, $scfg) = @_;
+
+    # verify that vlan-allowed don't conflict with another vlan-allowed transport
+
+    # verify that vlan-allowed is matching currently vnet tag in this transport
+}
+
 1;
 
 
index 983e6a2e332c79ec128d0d2875c9ec74ddac2a54..6ee1a3ec90919d11ef0e0dd8893b0220e73ef5a9 100644 (file)
@@ -67,5 +67,11 @@ sub on_delete_hook {
     # verify than no vm or ct have interfaces in this bridge
 }
 
+sub on_update_hook {
+    my ($class, $networkid, $scfg) = @_;
+
+    # verify that tag is not already defined in another vnet
+
+}
 
 1;
index 901f42542cfa67c66535342afdce342a1a8f67db..ae4ec1a2ad111e5764d5f7e73050af6d6ae93954 100644 (file)
@@ -86,6 +86,15 @@ sub on_delete_hook {
     # verify that no vnet are associated to this transport
 }
 
+sub on_update_hook {
+    my ($class, $networkid, $scfg) = @_;
+
+    # verify that vxlan-allowed don't conflict with another vxlan-allowed transport
+
+    # verify that vxlan-allowed is matching currently vnet tag in this transport  
+
+}
+
 1;