]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: Don't default to raw format for loader/NVRAM
authorAndrea Bolognani <abologna@redhat.com>
Tue, 16 May 2023 17:50:50 +0000 (19:50 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 21 Aug 2023 11:51:34 +0000 (13:51 +0200)
commit10a8997cbb402f7edb9f970af70feee2fc256a1c
treece8e04a280db92ab7a0f9ae4e991ae4f119dd5d7
parentb845e376a45a8e93f933a4a41068a9ce27adf755
conf: Don't default to raw format for loader/NVRAM

Due to the way the information is stored by the XML parser, we've
had this quirk where specifying any information about the loader
or NVRAM would implicitly set its format to raw. That is,

  <nvram>/path/to/guest_VARS.fd</nvram>

would effectively be interpreted as

  <nvram format='raw'>/path/to/guest_VARS.fd</nvram>

forcing the use of raw format firmware even when qcow2 format
would normally be preferred based on the ordering of firmware
descriptors. This behavior can be worked around in a number of
ways, but it's fairly unintuitive.

In order to remove this quirk, move the selection of the default
firmware format from the parser down to the individual drivers.

Most drivers only support raw firmware images, so they can
unconditionally set the format early and be done with it; the
QEMU driver, however, supports multiple formats and so in that
case we want this default to be applied as late as possible,
when we have already ruled out the possibility of using qcow2
formatted firmware images.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
12 files changed:
src/bhyve/bhyve_firmware.c
src/conf/domain_conf.c
src/libxl/libxl_conf.c
src/libxl/xen_xl.c
src/libxl/xen_xm.c
src/qemu/qemu_firmware.c
tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.x86_64-latest.err [deleted file]
tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.xml
tests/qemuxml2argvdata/firmware-auto-efi-loader-secure-abi-update.x86_64-latest.args
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/firmware-auto-efi-loader-secure-abi-update.x86_64-latest.xml