From: Fiona Ebner <f.ebner@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Markus Frank <m.frank@proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu-server] fix: also add resource mappings that do not exist to missing mappings
Date: Thu, 10 Apr 2025 13:18:04 +0200 [thread overview]
Message-ID: <5e4910e7-d5bc-49a2-b09b-c792009dd5e1@proxmox.com> (raw)
In-Reply-To: <20250410105925.174008-1-m.frank@proxmox.com>
Am 10.04.25 um 12:59 schrieb Markus Frank:
> 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@proxmox.com>
> ---
> This patch supersedes "fix: print error message that the resource
> mapping entry does not exist"
>
> PVE/QemuServer.pm | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index ccdceedc..2790942c 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -2512,7 +2512,7 @@ sub check_local_resources {
> } elsif ($type eq 'dir') {
> $entry = PVE::Mapping::Dir::get_node_mapping($dir_map, $id, $node);
> }
> - if (!scalar($entry->@*)) {
> + if (!$entry || !scalar($entry->@*)) {
> push @{$missing_mappings_by_node->{$node}}, $key;
> }
> }
Looking at this more closely, I think v1 is better actually. Sorry, I
had misunderstood the exact situation when the issue happens.
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-04-10 11:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 10:59 Markus Frank
2025-04-10 11:18 ` Fiona Ebner [this message]
2025-04-10 12:14 ` Markus Frank via pve-devel
[not found] ` <546be58f-8c82-435d-89fa-79cc0c278991@proxmox.com>
2025-04-10 12:30 ` Fiona Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5e4910e7-d5bc-49a2-b09b-c792009dd5e1@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=m.frank@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal