From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH ha-manager 0/1] api: relocate/migrate resource: improve initialization of variables to avoid Perl warning
Date: Wed, 1 Oct 2025 16:02:45 +0200 [thread overview]
Message-ID: <20251001140253.121445-1-f.ebner@proxmox.com> (raw)
As reported in the community forum [0], the resource relocation
endpoint would produce a warning:
> Can't use an undefined value as an ARRAY reference
In the get_resource_motion_info() function, properly initialize the
array references in the $blocking_resources_by_node hash to avoid
this. Note that the migration endpoint needs to be adapted to only
include 'blocking-resources' in the result if there is at least one
entry in the array to be compatible with this change. Align the
behavior of both migration and relocation endpoints, so that the
migration endpoint correctly handles the initialized, but empty array
too.
Alternatively, it could've been done the other way with the relocation
endpoint also checking for the array reference to be undefined if no
entries are to be added to the array, but since $comigrated_resources
is also initialized when empty, it seemed cleaner to go with the
approach here.
[0]: https://forum.proxmox.com/threads/173149/
pve-ha-manager:
Fiona Ebner (1):
api: relocate/migrate resource: improve initialization of variables to
avoid Perl warning
src/PVE/API2/HA/Resources.pm | 2 +-
src/PVE/HA/Config.pm | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
Summary over all repositories:
2 files changed, 2 insertions(+), 1 deletions(-)
--
Generated by git-murpp 0.5.0
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next reply other threads:[~2025-10-01 14:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-01 14:02 Fiona Ebner [this message]
2025-10-01 14:02 ` [pve-devel] [PATCH ha-manager 1/1] " Fiona Ebner
2025-10-01 14:06 ` 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=20251001140253.121445-1-f.ebner@proxmox.com \
--to=f.ebner@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