]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: support stateless UEFI firmware
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 22 Jul 2022 14:27:55 +0000 (15:27 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 26 Jul 2022 14:41:44 +0000 (15:41 +0100)
commit578ac25c6ae86d3f655ad902d1bcb57beff0e936
tree0e412ce9d6323679ba7c87b32553ee6f93c3ab16
parent429c15259c978ba3de6c8a28c5f54b7adbe4abad
conf: support stateless UEFI firmware

Normally when an UEFI firmware is marked as read-only, an associated
NVRAM file will be created. Some builds of UEFI firmware, however, wish
to remain stateless and so will be read-only, but never have any NVRAM
file. To represent this concept a 'stateless' tristate bool attribute
is introduced on the <loader/> element.

There are rather a large number of permutations to consider.

With default firmware selection

  *  <os/>

     => Historic default, no change

  *  <os>
       <loader stateless='yes'/>
     </os>

     => Explicit version of historic default, no change

  *  <os>
       <loader stateless='no'/>
     </os>

      => Invalid, bios is always stateless

With manual legacy BIOS selection

  *  <os>
       <loader>/path/to/seabios</loader>
       ...
     </os>

     => Historic default, no change

  *  <os>
       <loader stateless='yes'>/path/to/seabios</loader>
       ...
     </os>

     => Explicit version of historic default, no change

  *  <os>
       <loader stateless='no'>/path/to/seabios</loader>
       ...
     </os>

      => Invalid, bios is always stateless

With manual UEFI selection

  *  <os>
       <loader type='pflash'>/path/to/edk2</loader>
       ...
     </os>

     => Historic default, no change

  *  <os>
       <loader type='pflash' stateless='yes'>/path/to/edk2</loader>
       ...
     </os>

     => Skip auto-filling NVRAM / template

  *  <os>
       <loader type='pflash' stateless='no'>/path/to/edk2</loader>
       ...
     </os>

     => Explicit version of historic default, no change

With automatic firmware selection

  *  <os firmware='bios'/>

     => Historic default, no change

  *  <os firmware='bios'>
       <loader stateless='yes'/>
     </os>

     => Explicit version of historic default, no change

  *  <os firmware='bios'>
       <loader stateless='no'/>
     </os>

      => Invalid, bios is always stateless

  *  <os firmware='uefi'/>

     => Historic default, no change

  *  <os firmware='uefi'>
       <loader stateless='yes'/>
     </os>

     => Skip auto-filling NVRAM / template

  *  <os firmware='uefi'>
       <loader stateless='no'/>
     </os>

     => Explicit version of historic default, no change

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
22 files changed:
docs/formatdomain.rst
src/conf/domain_conf.c
src/conf/domain_conf.h
src/conf/domain_validate.c
src/conf/schemas/domaincommon.rng
tests/qemuxml2argvdata/firmware-auto-bios-not-stateless.x86_64-latest.err [new file with mode: 0644]
tests/qemuxml2argvdata/firmware-auto-bios-not-stateless.xml [new file with mode: 0644]
tests/qemuxml2argvdata/firmware-auto-bios-stateless.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/firmware-auto-bios-stateless.xml [new file with mode: 0644]
tests/qemuxml2argvdata/firmware-manual-bios-not-stateless.err [new file with mode: 0644]
tests/qemuxml2argvdata/firmware-manual-bios-not-stateless.xml [new file with mode: 0644]
tests/qemuxml2argvdata/firmware-manual-bios-stateless.args [new file with mode: 0644]
tests/qemuxml2argvdata/firmware-manual-bios-stateless.xml [new file with mode: 0644]
tests/qemuxml2argvdata/firmware-manual-efi-nvram-stateless.x86_64-latest.err [new file with mode: 0644]
tests/qemuxml2argvdata/firmware-manual-efi-nvram-stateless.xml [new file with mode: 0644]
tests/qemuxml2argvdata/firmware-manual-efi-nvram-template-stateless.x86_64-latest.err [new file with mode: 0644]
tests/qemuxml2argvdata/firmware-manual-efi-nvram-template-stateless.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/firmware-auto-bios-stateless.x86_64-latest.xml [new file with mode: 0644]
tests/qemuxml2xmloutdata/firmware-manual-bios-stateless.xml [new file with mode: 0644]
tests/qemuxml2xmloutdata/firmware-manual-bios.xml [new file with mode: 0644]
tests/qemuxml2xmltest.c