]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Rewrite qemuFirmwareFetchParsedConfigs()
authorAndrea Bolognani <abologna@redhat.com>
Thu, 29 Feb 2024 15:16:53 +0000 (16:16 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 4 Mar 2024 13:36:37 +0000 (14:36 +0100)
commite0438b2e80fd64f88c63084cc7a6e6986a0af1d5
tree09889cd272d5012146f218573b5ab9bc386d3878
parentdcad670212cac36cca2c523420ab24e35f91ef87
qemu: Rewrite qemuFirmwareFetchParsedConfigs()

Instead of returning the list of paths exactly as obtained
from qemuFirmwareFetchConfigs(), and allocating the list of
firmwares to be exactly that size right away, start with two
empty lists and add elements to them one by one.

At the moment this only makes things more verbose, but later
we're going to change things so that it's possible that some
of the paths/firmwares are not included in the lists returned
to the caller, and at that point the changes will pay off.

Note that we can't use g_auto() for the new list of paths,
because until the very last moment it's not null-terminated,
so g_strfreev() wouldn't be able to handle it correctly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_firmware.c