[pve-devel] [PATCH qemu-server v2] fix: print error message that the resource mapping entry does not exist

Markus Frank m.frank at proxmox.com
Thu Apr 10 15:09:40 CEST 2025


Currently you get a "Can't use an undefined value..." error because all
get_node_mapping functions return undefined if there is no resource
mapping entry for the id.

Fixes: a52eb3c4e ("check local resources: extend for mapped resources")
Signed-off-by: Markus Frank <m.frank at proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner at proxmox.com>
---
 PVE/QemuServer.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index ccdceedc..76783783 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2512,6 +2512,7 @@ sub check_local_resources {
 	    } elsif ($type eq 'dir') {
 		$entry = PVE::Mapping::Dir::get_node_mapping($dir_map, $id, $node);
 	    }
+	    die "$key: no $type resource mapping for id $id\n" if !$entry;
 	    if (!scalar($entry->@*)) {
 		push @{$missing_mappings_by_node->{$node}}, $key;
 	    }
-- 
2.39.5





More information about the pve-devel mailing list