]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: support firmware descriptor flash 'mode' for optional NVRAM
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 3 Feb 2022 13:43:18 +0000 (13:43 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 23 Feb 2022 18:11:08 +0000 (18:11 +0000)
commit32b9d8b0ae00669555f01f91ee11612a636c4b69
treee6c03e63a918f1fbd94bce33ddd44d82f56d598d
parent5adfb3472342741c443ac91dee0abb18b5a3d038
qemu: support firmware descriptor flash 'mode' for optional NVRAM

Currently the 'nvram_template' entry is mandatory when parsing the
firmware descriptor based on flash. QEMU is extending the firmware
descriptor spec to make the 'nvram_template' optional, depending
on the value of a new 'mode' field:

  - "split"
      * "executable" contains read-only CODE
      * "nvram_template" contains read-write VARS

  - "combined"
      * "executable" contains read-write CODE and VARs
      * "nvram_template" not present

  - "stateless"
      * "executable" contains read-only CODE and VARs
      * "nvram_template" not present

In the latter case, the guest OS can write vars but the
firmware will make no attempt to persist them, so any changes
will be lost at poweroff.

For now we parse this new 'mode' but discard any firmware
which is not 'mode=split' when matching for a domain.

In the tests we have a mixture of files with and without the
mode attribute.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_firmware.c
tests/qemufirmwaredata/out/usr/share/qemu/firmware/50-ovmf-sb-keys.json [new file with mode: 0644]
tests/qemufirmwaredata/out/usr/share/qemu/firmware/61-ovmf.json [new file with mode: 0644]
tests/qemufirmwaredata/out/usr/share/qemu/firmware/70-aavmf.json [new file with mode: 0644]
tests/qemufirmwaredata/usr/share/qemu/firmware/45-ovmf-sev-stateless.json [new file with mode: 0644]
tests/qemufirmwaredata/usr/share/qemu/firmware/55-ovmf-sb-combined.json [new file with mode: 0644]
tests/qemufirmwaredata/usr/share/qemu/firmware/60-ovmf-sb.json
tests/qemufirmwaretest.c