[pve-devel] [qemu-server 1/1] add_next_free_cidr: remove old dhcprange param

Alexandre Derumier aderumier at odiso.com
Thu Jan 4 17:27:28 CET 2024


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 600d0a8..a00e09e 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -5279,7 +5279,7 @@ sub vmconfig_apply_pending {
 			}
 		   }
 		   #fixme: reuse ip if mac change && same bridge
-		   PVE::Network::SDN::Vnets::add_next_free_cidr($new_net->{bridge}, $conf->{name}, $new_net->{macaddr}, $vmid, undef, 1);
+		   PVE::Network::SDN::Vnets::add_next_free_cidr($new_net->{bridge}, $conf->{name}, $new_net->{macaddr}, $vmid);
 		}
 	    }
 	};
@@ -5349,7 +5349,7 @@ sub vmconfig_update_net {
 		if (safe_string_ne($oldnet->{bridge}, $newnet->{bridge})) {
 		    if ($have_sdn) {
 			PVE::Network::SDN::Vnets::del_ips_from_mac($oldnet->{bridge}, $oldnet->{macaddr}, $conf->{name});
-			PVE::Network::SDN::Vnets::add_next_free_cidr($newnet->{bridge}, $conf->{name}, $newnet->{macaddr}, $vmid, undef, 1);
+			PVE::Network::SDN::Vnets::add_next_free_cidr($newnet->{bridge}, $conf->{name}, $newnet->{macaddr}, $vmid);
 		    }
 		}
 
@@ -5381,7 +5381,7 @@ sub vmconfig_update_net {
 
     if ($hotplug) {
 	if ($have_sdn) {
-	    PVE::Network::SDN::Vnets::add_next_free_cidr($newnet->{bridge}, $conf->{name}, $newnet->{macaddr}, $vmid, undef, 1);
+	    PVE::Network::SDN::Vnets::add_next_free_cidr($newnet->{bridge}, $conf->{name}, $newnet->{macaddr}, $vmid);
 	    PVE::Network::SDN::Vnets::add_dhcp_mapping($newnet->{bridge}, $newnet->{macaddr}, $vmid, $conf->{name});
 	}
 	vm_deviceplug($storecfg, $conf, $vmid, $opt, $newnet, $arch, $machine_type);
@@ -8691,7 +8691,7 @@ sub create_ifaces_ipams_ips {
         if ($opt =~ m/^net(\d+)$/) {
             my $value = $conf->{$opt};
             my $net = PVE::QemuServer::parse_net($value);
-            eval { PVE::Network::SDN::Vnets::add_next_free_cidr($net->{bridge}, $conf->{name}, $net->{macaddr}, $vmid, undef, 1) };
+            eval { PVE::Network::SDN::Vnets::add_next_free_cidr($net->{bridge}, $conf->{name}, $net->{macaddr}, $vmid) };
             warn $@ if $@;
         }
     }
-- 
2.39.2




More information about the pve-devel mailing list