From c5a01a4a756ead17412209d2046ef4e57d97b56c Mon Sep 17 00:00:00 2001 From: Michal Fox Date: Sat, 26 Sep 2026 08:41:15 +0000 Subject: [PATCH] fix #6907: memory: allow multi-digit host nodes with hugepages When hugepages are enabled, each custom NUMA node must be bound to a single host node. This was checked with a regex that only accepts a single digit, so any host node from 10 upwards was rejected with a misleading "more than 1 hostnode value" error, making hugepages unusable on hosts with more than ten NUMA nodes. Accept any single node number instead. Ranges and lists are still rejected as before. Signed-off-by: Michal Fox Reviewed-by: Max R. Carrara Tested-by: Max R. Carrara Link: https://lore.proxmox.com/20260926084115.7-1-me@dualfroz.com [TL: add a multi-digit host node case to the memory tests] Signed-off-by: Thomas Lamprecht --- src/PVE/QemuServer/Memory.pm | 2 +- src/test/run_memory_tests.pl | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PVE/QemuServer/Memory.pm b/src/PVE/QemuServer/Memory.pm index 585589e..8cbbac8 100644 --- a/src/PVE/QemuServer/Memory.pm +++ b/src/PVE/QemuServer/Memory.pm @@ -649,7 +649,7 @@ sub hugepages_topology { my $hostnodes = print_numa_hostnodes($hostnodelists); die "more than 1 hostnode value in numa node is not supported when hugepages are enabled" - if $hostnodes !~ m/^(\d)$/; + if $hostnodes !~ m/^\d+$/; my $hugepages_size = hugepages_size($conf, $numa_memory); $hugepages_topology->{$hugepages_size}->{$hostnodes} += hugepages_nr($numa_memory, $hugepages_size); diff --git a/src/test/run_memory_tests.pl b/src/test/run_memory_tests.pl index e8484e8..97b8996 100644 --- a/src/test/run_memory_tests.pl +++ b/src/test/run_memory_tests.pl @@ -17,6 +17,7 @@ $memory_module->mock('hugepages_chunk_size_supported', sub { return 1; }); my $tests = [ ['0', '0', 1], ['9', '9', 1], + ['10', '10', 1], ['0;1', '0,1', 0], ['0;10', '0,10', 0], ['0;1;10', '0,1,10', 0],