mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-10-21 15:18:19 +00:00
74954c9bc6
requested_firmware was called as
requested_firmware($confdata->{vm}->{$node}->[0]->{othersettings}). An rvalue
dereference chain autovivifies its intermediate links, so that read makes
$confdata->{vm}->{$node} exist, as an arrayref holding an empty hashref, for a
node with no vm row. A later truth test on that row then answers yes for a node
that is not a VM.
vm_othersettings reads the column one link at a time and returns undef at the
first link that is absent, so the read leaves $confdata as it was. Both call
sites use it.
Three checks in kvm_uefi_firmware.t hold this down, and all three fail when
vm_othersettings is changed back to the dereference chain: the read creates no
vm table, creates no row for the node, and leaves confdata equal to its
starting value.
build_xmldesc and build_diskstruct still autovivify the same row through their
own older reads of vm.storagemodel and vm.host. That is unchanged by this
commit and is measurable: the confdata both routines leave for a node with no
vm row is identical with and without the firmware code.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>