[pve-devel] [PATCH qemu-server 16/19] machine: rename machine_version() function to machine_version_at_least()

Fiona Ebner f.ebner at proxmox.com
Fri Jan 3 16:57:59 CET 2025


The old name does not make it clear what exactly the function does.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 PVE/QemuServer.pm         | 4 ++--
 PVE/QemuServer/Machine.pm | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 12e5543d..5e577431 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -4521,7 +4521,7 @@ sub qemu_cpu_hotplug {
 
     if ($vcpus < $currentvcpus) {
 
-	if (PVE::QemuServer::Machine::machine_version($machine_type, 2, 7)) {
+	if (PVE::QemuServer::Machine::machine_version_at_least($machine_type, 2, 7)) {
 
 	    for (my $i = $currentvcpus; $i > $vcpus; $i--) {
 		qemu_devicedel($vmid, "cpu$i");
@@ -4549,7 +4549,7 @@ sub qemu_cpu_hotplug {
     die "vcpus in running vm does not match its configuration\n"
 	if scalar(@{$currentrunningvcpus}) != $currentvcpus;
 
-    if (PVE::QemuServer::Machine::machine_version($machine_type, 2, 7)) {
+    if (PVE::QemuServer::Machine::machine_version_at_least($machine_type, 2, 7)) {
 	my $arch = PVE::QemuServer::Helpers::get_vm_arch($conf);
 
 	for (my $i = $currentvcpus+1; $i <= $vcpus; $i++) {
diff --git a/PVE/QemuServer/Machine.pm b/PVE/QemuServer/Machine.pm
index 9b18cf6e..6398e756 100644
--- a/PVE/QemuServer/Machine.pm
+++ b/PVE/QemuServer/Machine.pm
@@ -136,7 +136,7 @@ sub extract_version {
     return;
 }
 
-sub machine_version {
+sub machine_version_at_least {
     my ($machine_type, $major, $minor, $pve) = @_;
 
     return PVE::QemuServer::Helpers::min_version(
-- 
2.39.5





More information about the pve-devel mailing list