libvirt/tests
Andrea Bolognani 9567f3ba1f qemu: Move firmware selection from startup to postparse
Currently, firmware selection is performed as part of the
domain startup process. This mostly works fine, but there's a
significant downside to this approach: since the process is
affected by factors outside of libvirt's control, specifically
the contents of the various JSON firmware descriptors and
their names, it's pretty much impossible to guarantee that the
outcome is always going to be the same. It would only take an
edk2 update, or a change made by the local admin, to render a
domain unbootable or downgrade its boot security.

To avoid this, move firmware selection to the postparse phase.
This way it will only be performed once, when the domain is
first defined; subsequent boots will not need to go through
the process again, as all the paths that were picked during
firmware selection are recorded in the domain XML.

Care is taken to ensure that existing domains are handled
correctly, even if their firmware configuration can't be
successfully resolved. Failure to complete the firmware
selection process is only considered fatal when defining a
new domain; in all other cases the error will be reported
during startup, as is already the case today.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-03-03 13:49:56 +01:00
..
bhyveargv2xmldata
bhyvefirmwaredata
bhyvexml2argvdata
bhyvexml2xmloutdata
capabilityschemadata
chxml2xmlin test: Introduce chxml2xmltest 2023-02-14 13:59:45 +01:00
chxml2xmlout test: Introduce chxml2xmltest 2023-02-14 13:59:45 +01:00
commanddata commandtest: Test virCommandSetSendBuffer() with virCommandDoAsyncIO() 2022-12-01 14:22:39 +01:00
cputestdata cpu_map: Add missing x86 feature "vgif" 2022-11-08 21:45:02 +01:00
domainbackupxml2xmlin
domainbackupxml2xmlout backup: Allow configuring incremental backup per-disk individually 2020-07-08 08:40:30 +02:00
domaincapsdata cpu_s390: Implement getVendorForModel for IBM Z 2023-02-10 09:15:03 +01:00
domainconfdata
domainschemadata
fchostdata/fc_host
genericxml2xmlindata
genericxml2xmloutdata
interfaceschemadata
libxlxml2domconfigdata tests: Fix libxlxml2domconfigtest 2022-11-11 08:10:34 -07:00
lxcconf2xmldata
lxcxml2xmldata
lxcxml2xmloutdata
networkxml2confdata
networkxml2firewalldata
networkxml2xmlin
networkxml2xmlout
networkxml2xmlupdatein
networkxml2xmlupdateout
nodedevmdevctldata
nodedevschemadata
nodedevxml2xmlout nodedevschematest: Add example file for a HBA with 'vport_ops' capability 2022-09-01 13:11:09 +02:00
nssdata
nwfilterxml2firewalldata
nwfilterxml2xmlin
nwfilterxml2xmlout
qemuagentdata
qemublocktestdata
qemucapabilitiesdata qemu: capabilities: Introduce QEMU_CAPS_NETDEV_STREAM_RECONNECT 2023-02-22 08:25:36 -05:00
qemucaps2xmloutdata
qemudomaincheckpointxml2xmlin
qemudomaincheckpointxml2xmlout
qemudomainsnapshotxml2xmlin
qemudomainsnapshotxml2xmlout
qemufirmwaredata tests: Add descriptors for QCOW2 format firmware builds 2023-03-03 13:49:56 +01:00
qemuhotplugtestcpus
qemuhotplugtestdevices
qemuhotplugtestdomains
qemumemlockdata
qemumigparamsdata
qemumigrationcookiexmldata
qemumonitorjsondata
qemusecuritydata
qemustatusxml2xmldata qemustatusxml2xmltest: Add test data for testing '<origstates>' of PCI hostdev 2023-02-06 09:14:00 +01:00
qemuvhostuserdata
qemuxml2argvdata qemu: Don't pick firmware that requires SMM when smm=off 2023-03-03 13:49:56 +01:00
qemuxml2xmloutdata qemu: Move firmware selection from startup to postparse 2023-03-03 13:49:56 +01:00
schemas
secretxml2xmlin
securityselinuxhelperdata
securityselinuxlabeldata
storagepoolcapsschemadata
storagepoolschemadata
storagepoolxml2argvdata
storagepoolxml2xmlin
storagepoolxml2xmlout
storagevolschemadata
storagevolxml2argvdata
storagevolxml2xmlin
storagevolxml2xmlout
sysinfodata
vboxsnapshotxmldata
vircaps2xmldata
vircgroupdata
virconfdata
virfilecachedata
virfiledata
virhostcpudata
virjsondata
virmacmaptestdata
virnetdaemondata rpc: Fix error message in virNetServerSetClientLimits 2023-01-02 20:39:09 +01:00
virnetdevopenvswitchdata
virnetdevtestdata/sys/class/net
virnetworkportxml2xmldata conf: Format managed property of hostdev-pci ports correctly 2022-04-05 13:40:33 +02:00
virnwfilterbindingxml2xmldata
virpcitestdata
virprocessstatdata
virresctrldata
virscsidata
virstoragetestdata
virstorageutildata
virusbtestdata/sys_bus_usb/devices
vmwareverdata
vmx2xmldata Rename iterface type='dummy' to type='null' 2022-08-25 13:27:04 +02:00
xlconfigdata
xmconfigdata
xml2vmxdata
.valgrind.supp
bhyveargv2xmlmock.c
bhyveargv2xmltest.c
bhyvexml2argvmock.c maint: fix "mixing declarations and code" errors 2022-11-09 18:22:47 +01:00
bhyvexml2argvtest.c bhyvexml2argvtest: use virCommandToStringFull to strip command path 2021-04-21 14:20:03 +02:00
bhyvexml2xmltest.c
chxml2xmltest.c test: Introduce chxml2xmltest 2023-02-14 13:59:45 +01:00
commandhelper.c
commandtest.c commandtest: Comply with FreeBSD poll() 2022-12-01 17:24:31 +01:00
cputest.c qemuMonitorJSONGetCPUModelExpansion: Introduce @hv_passthrough argument 2023-01-05 12:35:33 +01:00
domaincapsmock.c
domaincapstest.c tests: add QEMU RISC-V "virt" machine in domaincapstest 2023-01-24 13:24:41 -03:00
domainconftest.c
esxutilstest.c tests: Use virTestCompareToString() more 2022-12-01 14:22:39 +01:00
eventtest.c
fchosttest.c
fdstreamtest.c
genericxml2xmltest.c
interfacexml2xmltest.c
libvirtd-fail Forget last daemon/ dir artefacts 2018-07-27 15:44:38 +02:00
libvirtd-pool
libxlmock.c tests: Fix libxlxml2domconfigtest 2022-11-11 08:10:34 -07:00
libxlxml2domconfigtest.c
lxcconf2xmltest.c
lxcxml2xmltest.c
meson.build test: Introduce chxml2xmltest 2023-02-14 13:59:45 +01:00
metadatatest.c
networkxml2conftest.c maint: fix "mixing declarations and code" errors 2022-11-09 18:22:47 +01:00
networkxml2firewalltest.c
networkxml2xmltest.c
networkxml2xmlupdatetest.c
nodedevmdevctltest.c
nodedevxml2xmltest.c
nsslinktest.c
nssmock.c
nsstest.c
nwfilterebiptablestest.c tests: Use virTestCompareToString() more 2022-12-01 14:22:39 +01:00
nwfilterxml2firewalltest.c
nwfilterxml2xmltest.c src/tests: use g_autoptr for virNWFilterDef and virNWFilterRuleDef 2023-01-20 22:09:34 +01:00
objecteventtest.c
openvzutilstest.c tests: Use virTestCompareToString() more 2022-12-01 14:22:39 +01:00
openvzutilstest.conf
permitted_file_access.txt
pkix_asn1_tab.c
qemuagenttest.c
qemublocktest.c
qemucapabilitiesnumbering.c
qemucapabilitiestest.c
qemucaps2xmlmock.c
qemucaps2xmltest.c
qemucapsprobe.c
qemucapsprobemock.c
qemucommandutiltest.c
qemucpumock.c
qemudomaincheckpointxml2xmltest.c
qemudomainsnapshotxml2xmltest.c
qemufirmwaretest.c tests: Add descriptors for QCOW2 format firmware builds 2023-03-03 13:49:56 +01:00
qemuhotplugmock.c
qemuhotplugtest.c conf: Use proper type for 'type' field of struct _virDomainDeviceDef 2023-02-06 13:34:29 +01:00
qemumemlocktest.c
qemumigparamstest.c
qemumigrationcookiexmltest.c qemu: Replace priv with qemuCaps in qemuMigrationCookieParse 2022-12-01 11:01:58 +01:00
qemumonitorjsontest.c qemu_monitor_json: allow configuring autofinalize for block commit 2023-01-09 13:32:44 +01:00
qemumonitortestutils.c qemumonitortestutils: Fix line counting in qemuMonitorTestProcessFileEntries() 2022-12-23 14:48:31 +01:00
qemumonitortestutils.h
qemusecuritymock.c
qemusecuritytest.c
qemusecuritytest.h
qemustatusxml2xmltest.c
qemuvhostusertest.c
qemuxml2argvmock.c
qemuxml2argvtest.c qemu: Don't pick firmware that requires SMM when smm=off 2023-03-03 13:49:56 +01:00
qemuxml2xmltest.c tests: Add more firmware tests 2023-03-03 13:40:53 +01:00
scsihosttest.c
seclabeltest.c
secretxml2xmltest.c
securityselinuxhelper.c meson: remove obsolete check for linux/magic.h 2022-12-12 10:36:13 +00:00
securityselinuxlabeltest.c
securityselinuxtest.c tests: Remove unused includes 2022-06-16 06:43:58 +02:00
shunloadhelper.c
shunloadtest.c
sockettest.c tests: Use virTestCompareToString() more 2022-12-01 14:22:39 +01:00
ssh.c
storagepoolcapstest.c
storagepoolxml2argvtest.c
storagepoolxml2xmltest.c
storagevolxml2argvtest.c
storagevolxml2xmltest.c
sysinfotest.c
test-lib.sh
testutils.c
testutils.h
testutilshostcpus.h tests: add QEMU RISC-V "virt" machine in domaincapstest 2023-01-24 13:24:41 -03:00
testutilslxc.c
testutilslxc.h
testutilsqemu.c qemuxml2argvtest: Add support for populating 'fds' in private data 2023-01-09 14:59:42 +01:00
testutilsqemu.h qemuxml2argvtest: Add support for populating 'fds' in private data 2023-01-09 14:59:42 +01:00
testutilsqemuschema.c
testutilsqemuschema.h
testutilsxen.c
testutilsxen.h
utiltest.c tests: Use virTestCompareToString() more 2022-12-01 14:22:39 +01:00
vboxsnapshotxmltest.c tests: Use virTestCompareToString() more 2022-12-01 14:22:39 +01:00
viralloctest.c
virauthconfigtest.c
virbitmaptest.c
virbuftest.c tests: Use virTestCompareToString() more 2022-12-01 14:22:39 +01:00
vircaps2xmltest.c
vircapstest.c
vircgroupmock.c
vircgrouptest.c
virconftest.c
vircryptotest.c
virdnsmasqmock.c
virdriverconnvalidatetest.c
virdrivermoduletest.c
virendiantest.c tests: Return EXIT_FAILURE/EXIT_SUCCESS instead of -1/0 2021-05-17 09:25:32 +02:00
virerrortest.c
virfilecachemock.c
virfilecachetest.c
virfilemock.c meson: remove obsolete check for linux/magic.h 2022-12-12 10:36:13 +00:00
virfiletest.c
virfilewrapper.c
virfilewrapper.h
virfirewallmock.c
virfirewalltest.c tests: Use virTestCompareToString() more 2022-12-01 14:22:39 +01:00
virgdbusmock.c
virhostcpumock.c
virhostcputest.c
virhostdevmock.c
virhostdevtest.c virhostdevtest: Decrease possibility of uninitialized @subsys 2023-02-06 16:33:26 +01:00
virhostidmock.c
viridentitytest.c
viriscsitest.c
virjsontest.c tests: Use virTestCompareToString() more 2022-12-01 14:22:39 +01:00
virkeycodetest.c
virkmodtest.c tests: Use virTestCompareToString() more 2022-12-01 14:22:39 +01:00
virlockspacetest.c
virlogtest.c
virmacmaptest.c tests: vir: remove pointless labels 2021-09-09 18:06:13 +02:00
virmigtest.c
virmock.h
virmockstathelpers.c virmockstathelpers: Load aliases for 64-bit time 2022-11-21 15:49:36 +01:00
virnetdaemonmock.c
virnetdaemontest.c rpc: Fix error message in virNetServerSetClientLimits 2023-01-02 20:39:09 +01:00
virnetdevbandwidthmock.c
virnetdevbandwidthtest.c tests: Use virTestCompareToString() more 2022-12-01 14:22:39 +01:00
virnetdevmock.c
virnetdevopenvswitchtest.c tests: Use virTestCompareToString() more 2022-12-01 14:22:39 +01:00
virnetdevtest.c
virnetmessagetest.c
virnetserverclientmock.c
virnetserverclienttest.c
virnetsockettest.c tests: Use virTestCompareToString() more 2022-12-01 14:22:39 +01:00
virnettlscontexttest.c tests: Drop needless virrandom mock from two tests 2022-11-21 15:36:08 +01:00
virnettlshelpers.c
virnettlshelpers.h
virnettlssessiontest.c tests: Drop needless virrandom mock from two tests 2022-11-21 15:36:08 +01:00
virnetworkportxml2xmltest.c
virnumamock.c
virnwfilterbindingxml2xmltest.c
virpcimock.c
virpcitest.c
virpcivpdtest.c
virpolkittest.c
virportallocatormock.c
virportallocatortest.c
virprocessmock.c
virprocessstattest.c
virrandommock.c
virresctrltest.c
virrotatingfiletest.c
virschematest.c
virscsitest.c
virsh-auth
virsh-auth.xml
virsh-checkpoint
virsh-cpuset
virsh-define-dev-segfault
virsh-int-overflow
virsh-optparse
virsh-output
virsh-output-commands
virsh-output.out
virsh-read-bufsiz
virsh-read-non-seekable tests: consistently source test-lib.sh in scripts 2016-04-23 15:41:40 -04:00
virsh-schedinfo
virsh-self-test
virsh-snapshot virsh: Add message to terminal when running snapshot-revert 2022-12-07 14:33:28 +01:00
virsh-start
virsh-undefine
virsh-uriprecedence
virsh-vcpupin
virshtest.c tests: Use virTestCompareToString() more 2022-12-01 14:22:39 +01:00
virstoragetest.c
virstorageutiltest.c
virstringtest.c
virsystemdtest.c
virt-aa-helper-test
virt-admin-self-test
virtestmock.c
virtimetest.c
virtypedparamtest.c
viruritest.c Drop checks for virURIFormat() retval 2023-02-08 16:50:45 +01:00
virusbmock.c
virusbtest.c
vmwarevertest.c
vmx2xmltest.c
vshtabletest.c
xlconfigtest.c
xmconfigtest.c
xml2vmxtest.c Rename iterface type='dummy' to type='null' 2022-08-25 13:27:04 +02:00