libvirt-9.5.0-6.el9

- tests: Use DO_TEST_CAPS_*_ABI_UPDATE() for ppc64 (rhbz#2196178)
- tests: Switch to firmware autoselection for hvf (rhbz#2196178)
- tests: Use virt-4.0 machine type for aarch64 (rhbz#2196178)
- tests: Consistently use /path/to/guest_VARS.fd (rhbz#2196178)
- tests: Turn abi-update.xml into a symlink (rhbz#2196178)
- tests: Rename firmware-auto-efi-nvram-path (rhbz#2196178)
- qemu: Fix return value for qemuFirmwareFillDomainLegacy() (rhbz#2196178)
- qemu: Fix lookup against stateless/combined pflash (rhbz#2196178)
- tests: Add some more DO_TEST*ABI_UPDATE* macros (rhbz#2196178)
- tests: Add more tests for firmware selection (rhbz#2196178)
- tests: Update firmware descriptor files (rhbz#2196178)
- tests: Drop tags from BIOS firmware descriptor (rhbz#2196178)
- tests: Include microvm in firmwaretest (rhbz#2196178)
- qemu: Don't overwrite NVRAM template for legacy firmware (rhbz#2196178)
- qemu: Generate NVRAM path in more cases (rhbz#2196178)
- qemu: Filter firmware based on loader.readonly (rhbz#2196178)
- qemu: Match NVRAM template extension for new domains (rhbz#2196178)
- conf: Don't default to raw format for loader/NVRAM (rhbz#2196178)
- tests: Rename firmware-auto-efi-format-loader-qcow2-nvram-path (rhbz#2196178)
- tests: Reintroduce firmware-auto-efi-format-mismatch (rhbz#2196178)
- rpm: Reorder scriptlets (rhbz#2210058)
- rpm: Reduce use of with_modular_daemons (rhbz#2210058)
- rpm: Remove custom libvirtd restart logic (rhbz#2210058)
- rpm: Introduce new macros for handling of systemd units (rhbz#2210058)
- rpm: Switch to new macros for handling of systemd units (rhbz#2210058)
- rpm: Delete unused macros (rhbz#2210058)

Resolves: rhbz#2196178, rhbz#2210058
This commit is contained in:
Jiri Denemark 2023-08-25 10:20:33 +02:00
parent d98c472cee
commit ac56d1c20b
21 changed files with 7360 additions and 213 deletions

View File

@ -0,0 +1,392 @@
From 7708f08af4581f11d9bc3c3cdf858e55ebdb5a6c Mon Sep 17 00:00:00 2001
Message-ID: <7708f08af4581f11d9bc3c3cdf858e55ebdb5a6c.1692951632.git.jdenemar@redhat.com>
From: Andrea Bolognani <abologna@redhat.com>
Date: Tue, 16 May 2023 19:50:50 +0200
Subject: [PATCH] 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>
(cherry picked from commit 10a8997cbb402f7edb9f970af70feee2fc256a1c)
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
src/bhyve/bhyve_firmware.c | 3 ++
src/conf/domain_conf.c | 21 ++++++----
src/libxl/libxl_conf.c | 15 +++++---
src/libxl/xen_xl.c | 2 +
src/libxl/xen_xm.c | 1 +
src/qemu/qemu_firmware.c | 27 +++++++++++--
...uto-efi-format-mismatch.x86_64-latest.args | 38 +++++++++++++++++++
...auto-efi-format-mismatch.x86_64-latest.err | 1 -
.../firmware-auto-efi-format-mismatch.xml | 2 +-
...oader-secure-abi-update.x86_64-latest.args | 8 ++--
tests/qemuxml2argvtest.c | 2 +-
...loader-secure-abi-update.x86_64-latest.xml | 4 +-
12 files changed, 98 insertions(+), 26 deletions(-)
create mode 100644 tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.x86_64-latest.args
delete mode 100644 tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.x86_64-latest.err
diff --git a/src/bhyve/bhyve_firmware.c b/src/bhyve/bhyve_firmware.c
index 57ab9c7a82..8aaf05dc62 100644
--- a/src/bhyve/bhyve_firmware.c
+++ b/src/bhyve/bhyve_firmware.c
@@ -80,6 +80,9 @@ bhyveFirmwareFillDomain(bhyveConn *driver,
if (!def->os.loader)
def->os.loader = virDomainLoaderDefNew();
+ if (!def->os.loader->format)
+ def->os.loader->format = VIR_STORAGE_FILE_RAW;
+
if (def->os.loader->format != VIR_STORAGE_FILE_RAW) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported loader format '%1$s'"),
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 5ac5c0b771..8fa0a6dc73 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3728,7 +3728,6 @@ virDomainLoaderDefNew(void)
virDomainLoaderDef *def = NULL;
def = g_new0(virDomainLoaderDef, 1);
- def->format = VIR_STORAGE_FILE_RAW;
return def;
}
@@ -16771,10 +16770,11 @@ virDomainLoaderDefParseXMLNvram(virDomainLoaderDef *loader,
if (virXMLPropEnumDefault(nvramNode, "format",
virStorageFileFormatTypeFromString, VIR_XML_PROP_NONE,
- &format, VIR_STORAGE_FILE_RAW) < 0) {
+ &format, VIR_STORAGE_FILE_NONE) < 0) {
return -1;
}
- if (format != VIR_STORAGE_FILE_RAW &&
+ if (format &&
+ format != VIR_STORAGE_FILE_RAW &&
format != VIR_STORAGE_FILE_QCOW2) {
virReportError(VIR_ERR_XML_ERROR,
_("Unsupported nvram format '%1$s'"),
@@ -16860,10 +16860,11 @@ virDomainLoaderDefParseXMLLoader(virDomainLoaderDef *loader,
if (virXMLPropEnumDefault(loaderNode, "format",
virStorageFileFormatTypeFromString, VIR_XML_PROP_NONE,
- &format, VIR_STORAGE_FILE_RAW) < 0) {
+ &format, VIR_STORAGE_FILE_NONE) < 0) {
return -1;
}
- if (format != VIR_STORAGE_FILE_RAW &&
+ if (format &&
+ format != VIR_STORAGE_FILE_RAW &&
format != VIR_STORAGE_FILE_QCOW2) {
virReportError(VIR_ERR_XML_ERROR,
_("Unsupported loader format '%1$s'"),
@@ -16894,7 +16895,9 @@ virDomainLoaderDefParseXML(virDomainLoaderDef *loader,
loaderNode) < 0)
return -1;
- if (loader->nvram && loader->format != loader->nvram->format) {
+ if (loader->nvram &&
+ loader->format && loader->nvram->format &&
+ loader->format != loader->nvram->format) {
virReportError(VIR_ERR_XML_ERROR,
_("Format mismatch: loader.format='%1$s' nvram.format='%2$s'"),
virStorageFileFormatTypeToString(loader->format),
@@ -26224,7 +26227,8 @@ virDomainLoaderDefFormatNvram(virBuffer *buf,
return -1;
}
- if (src->format != VIR_STORAGE_FILE_RAW) {
+ if (src->format &&
+ src->format != VIR_STORAGE_FILE_RAW) {
virBufferEscapeString(&attrBuf, " format='%s'",
virStorageFileFormatTypeToString(src->format));
}
@@ -26262,7 +26266,8 @@ virDomainLoaderDefFormat(virBuffer *buf,
virTristateBoolTypeToString(loader->stateless));
}
- if (loader->format != VIR_STORAGE_FILE_RAW) {
+ if (loader->format &&
+ loader->format != VIR_STORAGE_FILE_RAW) {
virBufferEscapeString(&loaderAttrBuf, " format='%s'",
virStorageFileFormatTypeToString(loader->format));
}
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index a1c76935b6..14ad320023 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -654,11 +654,16 @@ libxlMakeDomBuildInfo(virDomainDef *def,
b_info->u.hvm.system_firmware = g_strdup(def->os.loader->path);
}
- if (def->os.loader && def->os.loader->format != VIR_STORAGE_FILE_RAW) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unsupported loader format '%1$s'"),
- virStorageFileFormatTypeToString(def->os.loader->format));
- return -1;
+ if (def->os.loader) {
+ if (!def->os.loader->format)
+ def->os.loader->format = VIR_STORAGE_FILE_RAW;
+
+ if (def->os.loader->format != VIR_STORAGE_FILE_RAW) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported loader format '%1$s'"),
+ virStorageFileFormatTypeToString(def->os.loader->format));
+ return -1;
+ }
}
if (def->emulator) {
diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c
index 1cc42fa59f..ab1941454d 100644
--- a/src/libxl/xen_xl.c
+++ b/src/libxl/xen_xl.c
@@ -115,6 +115,7 @@ xenParseXLOS(virConf *conf, virDomainDef *def, virCaps *caps)
if (bios && STREQ(bios, "ovmf")) {
def->os.loader = virDomainLoaderDefNew();
+ def->os.loader->format = VIR_STORAGE_FILE_RAW;
def->os.loader->type = VIR_DOMAIN_LOADER_TYPE_PFLASH;
def->os.loader->readonly = VIR_TRISTATE_BOOL_YES;
if (bios_path)
@@ -126,6 +127,7 @@ xenParseXLOS(virConf *conf, virDomainDef *def, virCaps *caps)
if (caps->guests[i]->ostype == VIR_DOMAIN_OSTYPE_HVM &&
caps->guests[i]->arch.id == def->os.arch) {
def->os.loader = virDomainLoaderDefNew();
+ def->os.loader->format = VIR_STORAGE_FILE_RAW;
def->os.loader->path = g_strdup(caps->guests[i]->arch.defaultInfo.loader);
}
}
diff --git a/src/libxl/xen_xm.c b/src/libxl/xen_xm.c
index 0031d6cbc6..5705a5ec0c 100644
--- a/src/libxl/xen_xm.c
+++ b/src/libxl/xen_xm.c
@@ -43,6 +43,7 @@ xenParseXMOS(virConf *conf, virDomainDef *def)
g_autofree char *boot = NULL;
def->os.loader = virDomainLoaderDefNew();
+ def->os.loader->format = VIR_STORAGE_FILE_RAW;
if (xenConfigCopyString(conf, "kernel", &def->os.loader->path) < 0)
return -1;
diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
index ebaf32cf71..3dcd139a47 100644
--- a/src/qemu/qemu_firmware.c
+++ b/src/qemu/qemu_firmware.c
@@ -1082,6 +1082,11 @@ qemuFirmwareEnsureNVRAM(virDomainDef *def,
if (loader->stateless == VIR_TRISTATE_BOOL_YES)
return;
+ /* If the NVRAM format hasn't been set yet, inherit the same as
+ * the loader */
+ if (loader->nvram && !loader->nvram->format)
+ loader->nvram->format = loader->format;
+
/* If the source already exists and is fully specified, including
* the path, leave it alone */
if (loader->nvram && loader->nvram->path)
@@ -1328,7 +1333,7 @@ qemuFirmwareMatchDomain(const virDomainDef *def,
flash->executable.format);
return false;
}
- if (loader &&
+ if (loader && loader->format &&
STRNEQ(flash->executable.format, virStorageFileFormatTypeToString(loader->format))) {
VIR_DEBUG("Discarding loader with mismatching flash format '%s' != '%s'",
flash->executable.format,
@@ -1342,7 +1347,7 @@ qemuFirmwareMatchDomain(const virDomainDef *def,
flash->nvram_template.format);
return false;
}
- if (loader && loader->nvram &&
+ if (loader && loader->nvram && loader->nvram->format &&
STRNEQ(flash->nvram_template.format, virStorageFileFormatTypeToString(loader->nvram->format))) {
VIR_DEBUG("Discarding loader with mismatching nvram template format '%s' != '%s'",
flash->nvram_template.format,
@@ -1630,7 +1635,8 @@ qemuFirmwareFillDomainLegacy(virQEMUDriver *driver,
return 1;
}
- if (loader->format != VIR_STORAGE_FILE_RAW) {
+ if (loader->format &&
+ loader->format != VIR_STORAGE_FILE_RAW) {
VIR_DEBUG("Ignoring legacy entries for loader with flash format '%s'",
virStorageFileFormatTypeToString(loader->format));
return 1;
@@ -1793,6 +1799,7 @@ qemuFirmwareFillDomain(virQEMUDriver *driver,
return -1;
if (loader &&
+ loader->format &&
loader->format != VIR_STORAGE_FILE_RAW &&
loader->format != VIR_STORAGE_FILE_QCOW2) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -1801,6 +1808,7 @@ qemuFirmwareFillDomain(virQEMUDriver *driver,
return -1;
}
if (nvram &&
+ nvram->format &&
nvram->format != VIR_STORAGE_FILE_RAW &&
nvram->format != VIR_STORAGE_FILE_QCOW2) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -1831,8 +1839,19 @@ qemuFirmwareFillDomain(virQEMUDriver *driver,
* CODE:NVRAM pairs that might have been provided at build
* time */
if (!autoSelection) {
- if (qemuFirmwareFillDomainLegacy(driver, def) < 0)
+ if ((ret = qemuFirmwareFillDomainLegacy(driver, def)) < 0)
return -1;
+
+ /* If we've gotten this far without finding a match, it
+ * means that we're dealing with a set of completely
+ * custom paths. In that case, unless the user has
+ * specified otherwise, we have to assume that they're in
+ * raw format */
+ if (ret == 1) {
+ if (loader && !loader->format) {
+ loader->format = VIR_STORAGE_FILE_RAW;
+ }
+ }
} else {
virReportError(VIR_ERR_OPERATION_FAILED,
_("Unable to find any firmware to satisfy '%1$s'"),
diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.x86_64-latest.args b/tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.x86_64-latest.args
new file mode 100644
index 0000000000..e8d7d580f7
--- /dev/null
+++ b/tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.x86_64-latest.args
@@ -0,0 +1,38 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-guest \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
+/usr/bin/qemu-system-x86_64 \
+-name guest=guest,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
+-blockdev '{"driver":"file","filename":"/usr/share/edk2/ovmf/OVMF_CODE_4M.secboot.qcow2","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"qcow2","file":"libvirt-pflash0-storage"}' \
+-blockdev '{"driver":"file","filename":"/path/to/guest_VARS.qcow2","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"qcow2","file":"libvirt-pflash1-storage"}' \
+-machine pc-q35-4.0,usb=off,smm=on,dump-guest-core=off,memory-backend=pc.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,acpi=on \
+-accel kvm \
+-cpu qemu64 \
+-global driver=cfi.pflash01,property=secure,value=on \
+-m size=1048576k \
+-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 63840878-0deb-4095-97e6-fc444d9bc9fa \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-boot strict=on \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-global ICH9-LPC.noreboot=off \
+-watchdog-action reset \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.x86_64-latest.err b/tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.x86_64-latest.err
deleted file mode 100644
index abfdfc4357..0000000000
--- a/tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.x86_64-latest.err
+++ /dev/null
@@ -1 +0,0 @@
-XML error: Format mismatch: loader.format='qcow2' nvram.format='raw'
diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.xml b/tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.xml
index 6613d9e9a9..75fa44fd20 100644
--- a/tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.xml
+++ b/tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.xml
@@ -6,7 +6,7 @@
<os firmware='efi'>
<type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
<loader format='qcow2'/>
- <nvram>/path/to/guest_VARS.fd</nvram>
+ <nvram>/path/to/guest_VARS.qcow2</nvram>
</os>
<features>
<acpi/>
diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-loader-secure-abi-update.x86_64-latest.args b/tests/qemuxml2argvdata/firmware-auto-efi-loader-secure-abi-update.x86_64-latest.args
index 48f357cbf9..790fb619e8 100644
--- a/tests/qemuxml2argvdata/firmware-auto-efi-loader-secure-abi-update.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/firmware-auto-efi-loader-secure-abi-update.x86_64-latest.args
@@ -10,10 +10,10 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
-name guest=guest,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
--blockdev '{"driver":"file","filename":"/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
--blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
+-blockdev '{"driver":"file","filename":"/usr/share/edk2/ovmf/OVMF_CODE_4M.secboot.qcow2","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"qcow2","file":"libvirt-pflash0-storage"}' \
+-blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/guest_VARS.qcow2","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"qcow2","file":"libvirt-pflash1-storage"}' \
-machine pc-q35-4.0,usb=off,smm=on,dump-guest-core=off,memory-backend=pc.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,acpi=on \
-accel kvm \
-cpu qemu64 \
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 370b26a023..9439a5a1e6 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1117,7 +1117,7 @@ mymain(void)
DO_TEST_CAPS_LATEST("firmware-auto-efi-format-nvram-qcow2-network-nbd");
DO_TEST_CAPS_ARCH_LATEST("firmware-auto-efi-format-loader-raw", "aarch64");
DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("firmware-auto-efi-format-loader-raw-abi-update", "aarch64");
- DO_TEST_CAPS_LATEST_PARSE_ERROR("firmware-auto-efi-format-mismatch");
+ DO_TEST_CAPS_LATEST("firmware-auto-efi-format-mismatch");
DO_TEST_NOCAPS("clock-utc");
DO_TEST_NOCAPS("clock-localtime");
diff --git a/tests/qemuxml2xmloutdata/firmware-auto-efi-loader-secure-abi-update.x86_64-latest.xml b/tests/qemuxml2xmloutdata/firmware-auto-efi-loader-secure-abi-update.x86_64-latest.xml
index 332d931ba1..f4ff7a0fc2 100644
--- a/tests/qemuxml2xmloutdata/firmware-auto-efi-loader-secure-abi-update.x86_64-latest.xml
+++ b/tests/qemuxml2xmloutdata/firmware-auto-efi-loader-secure-abi-update.x86_64-latest.xml
@@ -10,8 +10,8 @@
<feature enabled='yes' name='enrolled-keys'/>
<feature enabled='yes' name='secure-boot'/>
</firmware>
- <loader readonly='yes' secure='yes' type='pflash'>/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd</loader>
- <nvram template='/usr/share/edk2/ovmf/OVMF_VARS.secboot.fd'>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
+ <loader readonly='yes' secure='yes' type='pflash' format='qcow2'>/usr/share/edk2/ovmf/OVMF_CODE_4M.secboot.qcow2</loader>
+ <nvram template='/usr/share/edk2/ovmf/OVMF_VARS_4M.secboot.qcow2' format='qcow2'>/var/lib/libvirt/qemu/nvram/guest_VARS.qcow2</nvram>
<boot dev='hd'/>
</os>
<features>
--
2.42.0

View File

@ -0,0 +1,77 @@
From a106b0bcb4fd652b9843257f799d9601151449b4 Mon Sep 17 00:00:00 2001
Message-ID: <a106b0bcb4fd652b9843257f799d9601151449b4.1692951632.git.jdenemar@redhat.com>
From: Andrea Bolognani <abologna@redhat.com>
Date: Fri, 26 May 2023 19:59:06 +0200
Subject: [PATCH] qemu: Don't overwrite NVRAM template for legacy firmware
Just because we have found a matching entry, it doesn't mean
that we should discard the information explicitly provided in
the domain XML.
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
https://gitlab.com/libvirt/libvirt/-/issues/500
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 4a49114ff47d4a9432d211200f734886f9ce200b)
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
src/qemu/qemu_firmware.c | 26 +++++++++++++++++--
...efi-secboot-legacy-paths.x86_64-latest.xml | 2 +-
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
index b1d342563b..a9437b5b95 100644
--- a/src/qemu/qemu_firmware.c
+++ b/src/qemu/qemu_firmware.c
@@ -1609,8 +1609,30 @@ qemuFirmwareFillDomainLegacy(virQEMUDriver *driver,
loader->type = VIR_DOMAIN_LOADER_TYPE_PFLASH;
loader->readonly = VIR_TRISTATE_BOOL_YES;
- VIR_FREE(loader->nvramTemplate);
- loader->nvramTemplate = g_strdup(cfg->firmwares[i]->nvram);
+ /* Only use the default template path if one hasn't been
+ * provided by the user.
+ *
+ * In addition to fully-custom templates, which are a valid
+ * use case, we could simply be in a situation where
+ * qemu.conf contains
+ *
+ * nvram = [
+ * "/path/to/OVMF_CODE.secboot.fd:/path/to/OVMF_VARS.fd",
+ * "/path/to/OVMF_CODE.secboot.fd:/path/to/OVMF_VARS.secboot.fd"
+ * ]
+ *
+ * and the domain has been configured as
+ *
+ * <os>
+ * <loader readonly='yes' type='pflash'>/path/to/OVMF_CODE.secboot.fd</loader>
+ * <nvram template='/path/to/OVMF/OVMF_VARS.secboot.fd'>
+ * </os>
+ *
+ * In this case, the global default is to have Secure Boot
+ * disabled, but the domain configuration explicitly enables
+ * it, and we shouldn't overrule this choice */
+ if (!loader->nvramTemplate)
+ loader->nvramTemplate = g_strdup(cfg->firmwares[i]->nvram);
qemuFirmwareEnsureNVRAM(def, cfg, VIR_STORAGE_FILE_RAW);
diff --git a/tests/qemuxml2xmloutdata/firmware-manual-efi-secboot-legacy-paths.x86_64-latest.xml b/tests/qemuxml2xmloutdata/firmware-manual-efi-secboot-legacy-paths.x86_64-latest.xml
index b8c2dfef66..9027123558 100644
--- a/tests/qemuxml2xmloutdata/firmware-manual-efi-secboot-legacy-paths.x86_64-latest.xml
+++ b/tests/qemuxml2xmloutdata/firmware-manual-efi-secboot-legacy-paths.x86_64-latest.xml
@@ -7,7 +7,7 @@
<os>
<type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
<loader readonly='yes' secure='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.secboot.fd</loader>
- <nvram template='/usr/share/OVMF/OVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
+ <nvram template='/usr/share/OVMF/OVMF_VARS.secboot.fd'>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
<boot dev='hd'/>
</os>
<features>
--
2.42.0

View File

@ -0,0 +1,340 @@
From 9b3f3afb21c64dc403fea734b1cb75a8bd2e4fc0 Mon Sep 17 00:00:00 2001
Message-ID: <9b3f3afb21c64dc403fea734b1cb75a8bd2e4fc0.1692951632.git.jdenemar@redhat.com>
From: Andrea Bolognani <abologna@redhat.com>
Date: Tue, 30 May 2023 18:01:58 +0200
Subject: [PATCH] qemu: Filter firmware based on loader.readonly
If the user included loader.readonly=no in the domain XML, we
should not pick a firmware build that expects to work with
loader.readonly=yes.
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit e96e322725f27d59ebcbd194c8da949b64bab9d6)
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
src/qemu/qemu_firmware.c | 12 ++++++
...-auto-efi-rw-abi-update.x86_64-latest.args | 38 -----------------
...e-auto-efi-rw-abi-update.x86_64-latest.err | 1 +
.../firmware-auto-efi-rw.x86_64-latest.args | 38 -----------------
.../firmware-auto-efi-rw.x86_64-latest.err | 1 +
...ual-efi-rw-legacy-paths.x86_64-latest.args | 6 +--
...ual-efi-rw-modern-paths.x86_64-latest.args | 6 +--
tests/qemuxml2argvtest.c | 4 +-
...e-auto-efi-rw-abi-update.x86_64-latest.xml | 41 -------------------
.../firmware-auto-efi-rw.x86_64-latest.xml | 8 +---
...nual-efi-rw-legacy-paths.x86_64-latest.xml | 3 +-
...nual-efi-rw-modern-paths.x86_64-latest.xml | 9 +---
tests/qemuxml2xmltest.c | 1 -
13 files changed, 24 insertions(+), 144 deletions(-)
delete mode 100644 tests/qemuxml2argvdata/firmware-auto-efi-rw-abi-update.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/firmware-auto-efi-rw-abi-update.x86_64-latest.err
delete mode 100644 tests/qemuxml2argvdata/firmware-auto-efi-rw.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/firmware-auto-efi-rw.x86_64-latest.err
delete mode 100644 tests/qemuxml2xmloutdata/firmware-auto-efi-rw-abi-update.x86_64-latest.xml
diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
index 2c9a03e6cf..3538654913 100644
--- a/src/qemu/qemu_firmware.c
+++ b/src/qemu/qemu_firmware.c
@@ -1295,6 +1295,13 @@ qemuFirmwareMatchDomain(const virDomainDef *def,
}
}
+ if (loader &&
+ loader->readonly == VIR_TRISTATE_BOOL_NO &&
+ flash->mode != QEMU_FIRMWARE_FLASH_MODE_COMBINED) {
+ VIR_DEBUG("Discarding readonly loader");
+ return false;
+ }
+
if (STRNEQ(flash->executable.format, "raw") &&
STRNEQ(flash->executable.format, "qcow2")) {
VIR_DEBUG("Discarding loader with unsupported flash format '%s'",
@@ -1593,6 +1600,11 @@ qemuFirmwareFillDomainLegacy(virQEMUDriver *driver,
return 1;
}
+ if (loader->readonly == VIR_TRISTATE_BOOL_NO) {
+ VIR_DEBUG("Ignoring legacy entries for read-write loader");
+ return 1;
+ }
+
if (loader->stateless == VIR_TRISTATE_BOOL_YES) {
VIR_DEBUG("Ignoring legacy entries for stateless loader");
return 1;
diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-rw-abi-update.x86_64-latest.args b/tests/qemuxml2argvdata/firmware-auto-efi-rw-abi-update.x86_64-latest.args
deleted file mode 100644
index 48f357cbf9..0000000000
--- a/tests/qemuxml2argvdata/firmware-auto-efi-rw-abi-update.x86_64-latest.args
+++ /dev/null
@@ -1,38 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/var/lib/libvirt/qemu/domain--1-guest \
-USER=test \
-LOGNAME=test \
-XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \
-XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \
-XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
-/usr/bin/qemu-system-x86_64 \
--name guest=guest,debug-threads=on \
--S \
--object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
--blockdev '{"driver":"file","filename":"/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
--blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
--machine pc-q35-4.0,usb=off,smm=on,dump-guest-core=off,memory-backend=pc.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,acpi=on \
--accel kvm \
--cpu qemu64 \
--global driver=cfi.pflash01,property=secure,value=on \
--m size=1048576k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \
--overcommit mem-lock=off \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid 63840878-0deb-4095-97e6-fc444d9bc9fa \
--display none \
--no-user-config \
--nodefaults \
--chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--boot strict=on \
--audiodev '{"id":"audio1","driver":"none"}' \
--global ICH9-LPC.noreboot=off \
--watchdog-action reset \
--sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
--msg timestamp=on
diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-rw-abi-update.x86_64-latest.err b/tests/qemuxml2argvdata/firmware-auto-efi-rw-abi-update.x86_64-latest.err
new file mode 100644
index 0000000000..4cfde1bd2e
--- /dev/null
+++ b/tests/qemuxml2argvdata/firmware-auto-efi-rw-abi-update.x86_64-latest.err
@@ -0,0 +1 @@
+operation failed: Unable to find any firmware to satisfy 'efi'
diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-rw.x86_64-latest.args b/tests/qemuxml2argvdata/firmware-auto-efi-rw.x86_64-latest.args
deleted file mode 100644
index 48f357cbf9..0000000000
--- a/tests/qemuxml2argvdata/firmware-auto-efi-rw.x86_64-latest.args
+++ /dev/null
@@ -1,38 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/var/lib/libvirt/qemu/domain--1-guest \
-USER=test \
-LOGNAME=test \
-XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \
-XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \
-XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
-/usr/bin/qemu-system-x86_64 \
--name guest=guest,debug-threads=on \
--S \
--object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
--blockdev '{"driver":"file","filename":"/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
--blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
--machine pc-q35-4.0,usb=off,smm=on,dump-guest-core=off,memory-backend=pc.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,acpi=on \
--accel kvm \
--cpu qemu64 \
--global driver=cfi.pflash01,property=secure,value=on \
--m size=1048576k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \
--overcommit mem-lock=off \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid 63840878-0deb-4095-97e6-fc444d9bc9fa \
--display none \
--no-user-config \
--nodefaults \
--chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--boot strict=on \
--audiodev '{"id":"audio1","driver":"none"}' \
--global ICH9-LPC.noreboot=off \
--watchdog-action reset \
--sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
--msg timestamp=on
diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-rw.x86_64-latest.err b/tests/qemuxml2argvdata/firmware-auto-efi-rw.x86_64-latest.err
new file mode 100644
index 0000000000..4cfde1bd2e
--- /dev/null
+++ b/tests/qemuxml2argvdata/firmware-auto-efi-rw.x86_64-latest.err
@@ -0,0 +1 @@
+operation failed: Unable to find any firmware to satisfy 'efi'
diff --git a/tests/qemuxml2argvdata/firmware-manual-efi-rw-legacy-paths.x86_64-latest.args b/tests/qemuxml2argvdata/firmware-manual-efi-rw-legacy-paths.x86_64-latest.args
index ccc279e4e3..85495da6f5 100644
--- a/tests/qemuxml2argvdata/firmware-manual-efi-rw-legacy-paths.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/firmware-manual-efi-rw-legacy-paths.x86_64-latest.args
@@ -11,10 +11,8 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
-blockdev '{"driver":"file","filename":"/usr/share/OVMF/OVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
--blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
--machine pc-q35-4.0,usb=off,dump-guest-core=off,memory-backend=pc.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,acpi=on \
+-blockdev '{"node-name":"libvirt-pflash0-format","read-only":false,"driver":"raw","file":"libvirt-pflash0-storage"}' \
+-machine pc-q35-4.0,usb=off,dump-guest-core=off,memory-backend=pc.ram,pflash0=libvirt-pflash0-format,acpi=on \
-accel tcg \
-cpu qemu64 \
-m size=1048576k \
diff --git a/tests/qemuxml2argvdata/firmware-manual-efi-rw-modern-paths.x86_64-latest.args b/tests/qemuxml2argvdata/firmware-manual-efi-rw-modern-paths.x86_64-latest.args
index 2d45fa4792..c26daad29f 100644
--- a/tests/qemuxml2argvdata/firmware-manual-efi-rw-modern-paths.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/firmware-manual-efi-rw-modern-paths.x86_64-latest.args
@@ -11,10 +11,8 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
-blockdev '{"driver":"file","filename":"/usr/share/edk2/ovmf/OVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
--blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
--machine pc-q35-4.0,usb=off,dump-guest-core=off,memory-backend=pc.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,acpi=on \
+-blockdev '{"node-name":"libvirt-pflash0-format","read-only":false,"driver":"raw","file":"libvirt-pflash0-storage"}' \
+-machine pc-q35-4.0,usb=off,dump-guest-core=off,memory-backend=pc.ram,pflash0=libvirt-pflash0-format,acpi=on \
-accel tcg \
-cpu qemu64 \
-m size=1048576k \
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index b2d9e00350..370b26a023 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1089,8 +1089,8 @@ mymain(void)
DO_TEST_CAPS_LATEST("firmware-auto-efi");
DO_TEST_CAPS_LATEST_ABI_UPDATE("firmware-auto-efi-abi-update");
DO_TEST_CAPS_LATEST("firmware-auto-efi-stateless");
- DO_TEST_CAPS_LATEST("firmware-auto-efi-rw");
- DO_TEST_CAPS_LATEST_ABI_UPDATE("firmware-auto-efi-rw-abi-update");
+ DO_TEST_CAPS_LATEST_FAILURE("firmware-auto-efi-rw");
+ DO_TEST_CAPS_LATEST_ABI_UPDATE_PARSE_ERROR("firmware-auto-efi-rw-abi-update");
DO_TEST_CAPS_LATEST("firmware-auto-efi-loader-secure");
DO_TEST_CAPS_LATEST_ABI_UPDATE("firmware-auto-efi-loader-secure-abi-update");
DO_TEST_CAPS_LATEST("firmware-auto-efi-loader-insecure");
diff --git a/tests/qemuxml2xmloutdata/firmware-auto-efi-rw-abi-update.x86_64-latest.xml b/tests/qemuxml2xmloutdata/firmware-auto-efi-rw-abi-update.x86_64-latest.xml
deleted file mode 100644
index 332d931ba1..0000000000
--- a/tests/qemuxml2xmloutdata/firmware-auto-efi-rw-abi-update.x86_64-latest.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<domain type='kvm'>
- <name>guest</name>
- <uuid>63840878-0deb-4095-97e6-fc444d9bc9fa</uuid>
- <memory unit='KiB'>1048576</memory>
- <currentMemory unit='KiB'>1048576</currentMemory>
- <vcpu placement='static'>1</vcpu>
- <os firmware='efi'>
- <type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
- <firmware>
- <feature enabled='yes' name='enrolled-keys'/>
- <feature enabled='yes' name='secure-boot'/>
- </firmware>
- <loader readonly='yes' secure='yes' type='pflash'>/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd</loader>
- <nvram template='/usr/share/edk2/ovmf/OVMF_VARS.secboot.fd'>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
- <boot dev='hd'/>
- </os>
- <features>
- <acpi/>
- <smm state='on'/>
- </features>
- <cpu mode='custom' match='exact' check='none'>
- <model fallback='forbid'>qemu64</model>
- </cpu>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash>
- <devices>
- <emulator>/usr/bin/qemu-system-x86_64</emulator>
- <controller type='usb' index='0' model='none'/>
- <controller type='sata' index='0'>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
- </controller>
- <controller type='pci' index='0' model='pcie-root'/>
- <input type='mouse' bus='ps2'/>
- <input type='keyboard' bus='ps2'/>
- <audio id='1' type='none'/>
- <watchdog model='itco' action='reset'/>
- <memballoon model='none'/>
- </devices>
-</domain>
diff --git a/tests/qemuxml2xmloutdata/firmware-auto-efi-rw.x86_64-latest.xml b/tests/qemuxml2xmloutdata/firmware-auto-efi-rw.x86_64-latest.xml
index 332d931ba1..c2d0c33a0b 100644
--- a/tests/qemuxml2xmloutdata/firmware-auto-efi-rw.x86_64-latest.xml
+++ b/tests/qemuxml2xmloutdata/firmware-auto-efi-rw.x86_64-latest.xml
@@ -6,17 +6,11 @@
<vcpu placement='static'>1</vcpu>
<os firmware='efi'>
<type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
- <firmware>
- <feature enabled='yes' name='enrolled-keys'/>
- <feature enabled='yes' name='secure-boot'/>
- </firmware>
- <loader readonly='yes' secure='yes' type='pflash'>/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd</loader>
- <nvram template='/usr/share/edk2/ovmf/OVMF_VARS.secboot.fd'>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
+ <loader readonly='no'/>
<boot dev='hd'/>
</os>
<features>
<acpi/>
- <smm state='on'/>
</features>
<cpu mode='custom' match='exact' check='none'>
<model fallback='forbid'>qemu64</model>
diff --git a/tests/qemuxml2xmloutdata/firmware-manual-efi-rw-legacy-paths.x86_64-latest.xml b/tests/qemuxml2xmloutdata/firmware-manual-efi-rw-legacy-paths.x86_64-latest.xml
index cfd7a6824f..c5baedc42c 100644
--- a/tests/qemuxml2xmloutdata/firmware-manual-efi-rw-legacy-paths.x86_64-latest.xml
+++ b/tests/qemuxml2xmloutdata/firmware-manual-efi-rw-legacy-paths.x86_64-latest.xml
@@ -6,8 +6,7 @@
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
- <loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
- <nvram template='/usr/share/OVMF/OVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
+ <loader readonly='no' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
<boot dev='hd'/>
</os>
<features>
diff --git a/tests/qemuxml2xmloutdata/firmware-manual-efi-rw-modern-paths.x86_64-latest.xml b/tests/qemuxml2xmloutdata/firmware-manual-efi-rw-modern-paths.x86_64-latest.xml
index 468ca022ef..0d755a4306 100644
--- a/tests/qemuxml2xmloutdata/firmware-manual-efi-rw-modern-paths.x86_64-latest.xml
+++ b/tests/qemuxml2xmloutdata/firmware-manual-efi-rw-modern-paths.x86_64-latest.xml
@@ -4,14 +4,9 @@
<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>1</vcpu>
- <os firmware='efi'>
+ <os>
<type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
- <firmware>
- <feature enabled='no' name='enrolled-keys'/>
- <feature enabled='no' name='secure-boot'/>
- </firmware>
- <loader readonly='yes' type='pflash'>/usr/share/edk2/ovmf/OVMF_CODE.fd</loader>
- <nvram template='/usr/share/edk2/ovmf/OVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
+ <loader readonly='no' type='pflash'>/usr/share/edk2/ovmf/OVMF_CODE.fd</loader>
<boot dev='hd'/>
</os>
<features>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index d3d4e4e585..3f2ef10df7 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -901,7 +901,6 @@ mymain(void)
DO_TEST_CAPS_LATEST_ABI_UPDATE("firmware-auto-efi-abi-update");
DO_TEST_CAPS_LATEST("firmware-auto-efi-stateless");
DO_TEST_CAPS_LATEST("firmware-auto-efi-rw");
- DO_TEST_CAPS_LATEST_ABI_UPDATE("firmware-auto-efi-rw-abi-update");
DO_TEST_CAPS_LATEST("firmware-auto-efi-loader-secure");
DO_TEST_CAPS_LATEST_ABI_UPDATE("firmware-auto-efi-loader-secure-abi-update");
DO_TEST_CAPS_LATEST("firmware-auto-efi-loader-insecure");
--
2.42.0

View File

@ -0,0 +1,46 @@
From f57a07068f7cc7ccdbf9814f9c69cbef1d2c9d6c Mon Sep 17 00:00:00 2001
Message-ID: <f57a07068f7cc7ccdbf9814f9c69cbef1d2c9d6c.1692951632.git.jdenemar@redhat.com>
From: Andrea Bolognani <abologna@redhat.com>
Date: Fri, 26 May 2023 17:47:42 +0200
Subject: [PATCH] qemu: Fix lookup against stateless/combined pflash
Just like the more common split builds, these are of type
QEMU_FIRMWARE_DEVICE_FLASH; however, they have no associated
NVRAM template, so we can't access the corresponding structure
member unconditionally or we'll trigger a crash.
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit ac76386edad3be2bbd6202a30063b9205011f5c5)
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
src/qemu/qemu_firmware.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
index 5f030ebce4..b1d342563b 100644
--- a/src/qemu/qemu_firmware.c
+++ b/src/qemu/qemu_firmware.c
@@ -971,9 +971,12 @@ qemuFirmwareMatchesPaths(const qemuFirmware *fw,
if (loader && loader->path &&
STRNEQ(loader->path, flash->executable.filename))
return false;
- if (loader && loader->nvramTemplate &&
- STRNEQ(loader->nvramTemplate, flash->nvram_template.filename))
- return false;
+ if (loader && loader->nvramTemplate) {
+ if (flash->mode != QEMU_FIRMWARE_FLASH_MODE_SPLIT)
+ return false;
+ if (STRNEQ(loader->nvramTemplate, flash->nvram_template.filename))
+ return false;
+ }
break;
case QEMU_FIRMWARE_DEVICE_MEMORY:
if (loader && loader->path &&
--
2.42.0

View File

@ -0,0 +1,48 @@
From 1fefaa42f98530ed449ea9aa4863c4c1bc5327b5 Mon Sep 17 00:00:00 2001
Message-ID: <1fefaa42f98530ed449ea9aa4863c4c1bc5327b5.1692951632.git.jdenemar@redhat.com>
From: Andrea Bolognani <abologna@redhat.com>
Date: Wed, 2 Aug 2023 17:18:32 +0200
Subject: [PATCH] qemu: Fix return value for qemuFirmwareFillDomainLegacy()
The documentation states that, just like the Modern() variant,
this function should return 1 if a match wasn't found. It
currently doesn't do that, and returns 0 instead.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit d917883b30f1d33f1df78394152e67b402b9c72e)
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
src/qemu/qemu_firmware.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
index cf9a45dc39..5f030ebce4 100644
--- a/src/qemu/qemu_firmware.c
+++ b/src/qemu/qemu_firmware.c
@@ -1575,17 +1575,17 @@ qemuFirmwareFillDomainLegacy(virQEMUDriver *driver,
size_t i;
if (!loader)
- return 0;
+ return 1;
if (loader->type != VIR_DOMAIN_LOADER_TYPE_PFLASH) {
VIR_DEBUG("Ignoring legacy entries for '%s' loader",
virDomainLoaderTypeToString(loader->type));
- return 0;
+ return 1;
}
if (loader->stateless == VIR_TRISTATE_BOOL_YES) {
VIR_DEBUG("Ignoring legacy entries for stateless loader");
- return 0;
+ return 1;
}
if (loader->format != VIR_STORAGE_FILE_RAW) {
--
2.42.0

View File

@ -0,0 +1,321 @@
From e71463f711cef030989717f401d0399ec6870705 Mon Sep 17 00:00:00 2001
Message-ID: <e71463f711cef030989717f401d0399ec6870705.1692951632.git.jdenemar@redhat.com>
From: Andrea Bolognani <abologna@redhat.com>
Date: Fri, 26 May 2023 14:40:02 +0200
Subject: [PATCH] qemu: Generate NVRAM path in more cases
Right now, we only generate it after finding a matching entry
either among firmware descriptors or in the legacy firmware
list.
Even if the domain is configured to use a custom firmware build
that we know nothing about, however, we should still automatically
generate the NVRAM path instead of requiring the user to provide
it manually.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit ccbb987707e282af8d7f8c0db47e70fdebab959f)
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
src/qemu/qemu_firmware.c | 52 +++++++++++--------
...loader-path-nonstandard.x86_64-latest.args | 37 +++++++++++++
...-loader-path-nonstandard.x86_64-latest.err | 1 -
...am-template-nonstandard.x86_64-latest.args | 37 +++++++++++++
...ram-template-nonstandard.x86_64-latest.err | 1 -
tests/qemuxml2argvtest.c | 4 +-
...-loader-path-nonstandard.x86_64-latest.xml | 2 +-
...ram-template-nonstandard.x86_64-latest.xml | 2 +-
8 files changed, 109 insertions(+), 27 deletions(-)
create mode 100644 tests/qemuxml2argvdata/firmware-manual-efi-loader-path-nonstandard.x86_64-latest.args
delete mode 100644 tests/qemuxml2argvdata/firmware-manual-efi-loader-path-nonstandard.x86_64-latest.err
create mode 100644 tests/qemuxml2argvdata/firmware-manual-efi-nvram-template-nonstandard.x86_64-latest.args
delete mode 100644 tests/qemuxml2argvdata/firmware-manual-efi-nvram-template-nonstandard.x86_64-latest.err
diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
index a9437b5b95..2c9a03e6cf 100644
--- a/src/qemu/qemu_firmware.c
+++ b/src/qemu/qemu_firmware.c
@@ -1053,7 +1053,7 @@ qemuFirmwareOSInterfaceTypeFromOsDefLoaderType(virDomainLoader type)
/**
* qemuFirmwareEnsureNVRAM:
* @def: domain definition
- * @cfg: QEMU driver configuration
+ * @driver: QEMU driver
*
* Make sure that a source for the NVRAM file exists, possibly by
* creating it. This might involve automatically generating the
@@ -1061,15 +1061,24 @@ qemuFirmwareOSInterfaceTypeFromOsDefLoaderType(virDomainLoader type)
*/
static void
qemuFirmwareEnsureNVRAM(virDomainDef *def,
- const virQEMUDriverConfig *cfg,
- virStorageFileFormat format)
+ virQEMUDriver *driver)
{
+ g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
virDomainLoaderDef *loader = def->os.loader;
const char *ext = NULL;
if (!loader)
return;
+ if (loader->type != VIR_DOMAIN_LOADER_TYPE_PFLASH)
+ return;
+
+ if (loader->readonly != VIR_TRISTATE_BOOL_YES)
+ return;
+
+ if (loader->stateless == VIR_TRISTATE_BOOL_YES)
+ return;
+
/* If the source already exists and is fully specified, including
* the path, leave it alone */
if (loader->nvram && loader->nvram->path)
@@ -1080,11 +1089,11 @@ qemuFirmwareEnsureNVRAM(virDomainDef *def,
loader->nvram = virStorageSourceNew();
loader->nvram->type = VIR_STORAGE_TYPE_FILE;
- loader->nvram->format = format;
+ loader->nvram->format = loader->format;
- if (format == VIR_STORAGE_FILE_RAW)
+ if (loader->nvram->format == VIR_STORAGE_FILE_RAW)
ext = ".fd";
- if (format == VIR_STORAGE_FILE_QCOW2)
+ if (loader->nvram->format == VIR_STORAGE_FILE_QCOW2)
ext = ".qcow2";
loader->nvram->path = g_strdup_printf("%s/%s_VARS%s",
@@ -1347,8 +1356,7 @@ qemuFirmwareMatchDomain(const virDomainDef *def,
static int
-qemuFirmwareEnableFeaturesModern(virQEMUDriverConfig *cfg,
- virDomainDef *def,
+qemuFirmwareEnableFeaturesModern(virDomainDef *def,
const qemuFirmware *fw)
{
const qemuFirmwareMappingFlash *flash = &fw->mapping.data.flash;
@@ -1377,16 +1385,15 @@ qemuFirmwareEnableFeaturesModern(virQEMUDriverConfig *cfg,
loader->path = g_strdup(flash->executable.filename);
if (flash->mode == QEMU_FIRMWARE_FLASH_MODE_SPLIT) {
- if ((format = virStorageFileFormatTypeFromString(flash->nvram_template.format)) < 0)
- return -1;
-
- qemuFirmwareEnsureNVRAM(def, cfg, format);
-
- /* If the NVRAM is not a local path then we can't create or
- * reset it, so in that case filling in the nvramTemplate
- * field would be misleading */
+ /* Only fill in nvramTemplate if the NVRAM location is already
+ * known to be a local path or hasn't been provided, in which
+ * case a local path will be generated by libvirt later.
+ *
+ * We can't create or reset non-local NVRAM files, so filling
+ * in nvramTemplate for those would be misleading */
VIR_FREE(loader->nvramTemplate);
- if (loader->nvram && virStorageSourceIsLocalStorage(loader->nvram)) {
+ if (!loader->nvram ||
+ (loader->nvram && virStorageSourceIsLocalStorage(loader->nvram))) {
loader->nvramTemplate = g_strdup(flash->nvram_template.filename);
}
}
@@ -1608,6 +1615,7 @@ qemuFirmwareFillDomainLegacy(virQEMUDriver *driver,
loader->type = VIR_DOMAIN_LOADER_TYPE_PFLASH;
loader->readonly = VIR_TRISTATE_BOOL_YES;
+ loader->format = VIR_STORAGE_FILE_RAW;
/* Only use the default template path if one hasn't been
* provided by the user.
@@ -1634,8 +1642,6 @@ qemuFirmwareFillDomainLegacy(virQEMUDriver *driver,
if (!loader->nvramTemplate)
loader->nvramTemplate = g_strdup(cfg->firmwares[i]->nvram);
- qemuFirmwareEnsureNVRAM(def, cfg, VIR_STORAGE_FILE_RAW);
-
VIR_DEBUG("decided on firmware '%s' template '%s'",
loader->path, NULLSTR(loader->nvramTemplate));
@@ -1664,7 +1670,6 @@ static int
qemuFirmwareFillDomainModern(virQEMUDriver *driver,
virDomainDef *def)
{
- g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
g_auto(GStrv) paths = NULL;
qemuFirmware **firmwares = NULL;
ssize_t nfirmwares = 0;
@@ -1695,7 +1700,7 @@ qemuFirmwareFillDomainModern(virQEMUDriver *driver,
* likely that admin/FW manufacturer messed up. */
qemuFirmwareSanityCheck(theone, paths[i]);
- if (qemuFirmwareEnableFeaturesModern(cfg, def, theone) < 0)
+ if (qemuFirmwareEnableFeaturesModern(def, theone) < 0)
goto cleanup;
ret = 0;
@@ -1802,6 +1807,11 @@ qemuFirmwareFillDomain(virQEMUDriver *driver,
}
}
+ /* Always ensure that the NVRAM path is present, even if we
+ * haven't found a match: the configuration might simply be
+ * referring to a custom firmware build */
+ qemuFirmwareEnsureNVRAM(def, driver);
+
return 0;
}
diff --git a/tests/qemuxml2argvdata/firmware-manual-efi-loader-path-nonstandard.x86_64-latest.args b/tests/qemuxml2argvdata/firmware-manual-efi-loader-path-nonstandard.x86_64-latest.args
new file mode 100644
index 0000000000..4e989344b3
--- /dev/null
+++ b/tests/qemuxml2argvdata/firmware-manual-efi-loader-path-nonstandard.x86_64-latest.args
@@ -0,0 +1,37 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-guest \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
+/usr/bin/qemu-system-x86_64 \
+-name guest=guest,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
+-blockdev '{"driver":"file","filename":"/path/to/OVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
+-blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
+-machine pc-q35-4.0,usb=off,dump-guest-core=off,memory-backend=pc.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,acpi=on \
+-accel tcg \
+-cpu qemu64 \
+-m size=1048576k \
+-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 63840878-0deb-4095-97e6-fc444d9bc9fa \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-boot strict=on \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-global ICH9-LPC.noreboot=off \
+-watchdog-action reset \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/firmware-manual-efi-loader-path-nonstandard.x86_64-latest.err b/tests/qemuxml2argvdata/firmware-manual-efi-loader-path-nonstandard.x86_64-latest.err
deleted file mode 100644
index 6a1618a1aa..0000000000
--- a/tests/qemuxml2argvdata/firmware-manual-efi-loader-path-nonstandard.x86_64-latest.err
+++ /dev/null
@@ -1 +0,0 @@
-internal error: argument key 'filename' must not have null value
diff --git a/tests/qemuxml2argvdata/firmware-manual-efi-nvram-template-nonstandard.x86_64-latest.args b/tests/qemuxml2argvdata/firmware-manual-efi-nvram-template-nonstandard.x86_64-latest.args
new file mode 100644
index 0000000000..1dc1993285
--- /dev/null
+++ b/tests/qemuxml2argvdata/firmware-manual-efi-nvram-template-nonstandard.x86_64-latest.args
@@ -0,0 +1,37 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-guest \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
+/usr/bin/qemu-system-x86_64 \
+-name guest=guest,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
+-blockdev '{"driver":"file","filename":"/usr/share/edk2/ovmf/OVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
+-blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
+-machine pc-q35-4.0,usb=off,dump-guest-core=off,memory-backend=pc.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,acpi=on \
+-accel kvm \
+-cpu qemu64 \
+-m size=1048576k \
+-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 63840878-0deb-4095-97e6-fc444d9bc9fa \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-boot strict=on \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-global ICH9-LPC.noreboot=off \
+-watchdog-action reset \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/firmware-manual-efi-nvram-template-nonstandard.x86_64-latest.err b/tests/qemuxml2argvdata/firmware-manual-efi-nvram-template-nonstandard.x86_64-latest.err
deleted file mode 100644
index 6a1618a1aa..0000000000
--- a/tests/qemuxml2argvdata/firmware-manual-efi-nvram-template-nonstandard.x86_64-latest.err
+++ /dev/null
@@ -1 +0,0 @@
-internal error: argument key 'filename' must not have null value
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 95842140f3..b2d9e00350 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1053,13 +1053,13 @@ mymain(void)
DO_TEST_CAPS_LATEST("firmware-manual-efi-rw-implicit");
DO_TEST_CAPS_LATEST("firmware-manual-efi-loader-secure");
DO_TEST_CAPS_LATEST_PARSE_ERROR("firmware-manual-efi-loader-no-path");
- DO_TEST_CAPS_LATEST_FAILURE("firmware-manual-efi-loader-path-nonstandard");
+ DO_TEST_CAPS_LATEST("firmware-manual-efi-loader-path-nonstandard");
DO_TEST_CAPS_LATEST("firmware-manual-efi-secboot");
DO_TEST_CAPS_LATEST("firmware-manual-efi-no-enrolled-keys");
DO_TEST_CAPS_LATEST("firmware-manual-efi-no-secboot");
DO_TEST_CAPS_LATEST("firmware-manual-efi-stateless");
DO_TEST_CAPS_LATEST("firmware-manual-efi-nvram-template");
- DO_TEST_CAPS_LATEST_FAILURE("firmware-manual-efi-nvram-template-nonstandard");
+ DO_TEST_CAPS_LATEST("firmware-manual-efi-nvram-template-nonstandard");
DO_TEST_CAPS_LATEST_PARSE_ERROR("firmware-manual-efi-nvram-template-stateless");
DO_TEST_CAPS_LATEST("firmware-manual-efi-nvram-network-iscsi");
DO_TEST_CAPS_LATEST("firmware-manual-efi-nvram-network-nbd");
diff --git a/tests/qemuxml2xmloutdata/firmware-manual-efi-loader-path-nonstandard.x86_64-latest.xml b/tests/qemuxml2xmloutdata/firmware-manual-efi-loader-path-nonstandard.x86_64-latest.xml
index 5940bfd0ea..039c485706 100644
--- a/tests/qemuxml2xmloutdata/firmware-manual-efi-loader-path-nonstandard.x86_64-latest.xml
+++ b/tests/qemuxml2xmloutdata/firmware-manual-efi-loader-path-nonstandard.x86_64-latest.xml
@@ -7,7 +7,7 @@
<os>
<type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
<loader readonly='yes' type='pflash'>/path/to/OVMF_CODE.fd</loader>
- <nvram template='/path/to/OVMF_VARS.fd'/>
+ <nvram template='/path/to/OVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
<boot dev='hd'/>
</os>
<features>
diff --git a/tests/qemuxml2xmloutdata/firmware-manual-efi-nvram-template-nonstandard.x86_64-latest.xml b/tests/qemuxml2xmloutdata/firmware-manual-efi-nvram-template-nonstandard.x86_64-latest.xml
index 816e285621..5433650516 100644
--- a/tests/qemuxml2xmloutdata/firmware-manual-efi-nvram-template-nonstandard.x86_64-latest.xml
+++ b/tests/qemuxml2xmloutdata/firmware-manual-efi-nvram-template-nonstandard.x86_64-latest.xml
@@ -7,7 +7,7 @@
<os>
<type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
<loader readonly='yes' type='pflash'>/usr/share/edk2/ovmf/OVMF_CODE.fd</loader>
- <nvram template='/path/to/OVMF_VARS.fd'/>
+ <nvram template='/path/to/OVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
<boot dev='hd'/>
</os>
<features>
--
2.42.0

View File

@ -0,0 +1,178 @@
From 6dbe828752378e2215d4fd4fca65c94372ad0cf2 Mon Sep 17 00:00:00 2001
Message-ID: <6dbe828752378e2215d4fd4fca65c94372ad0cf2.1692951632.git.jdenemar@redhat.com>
From: Andrea Bolognani <abologna@redhat.com>
Date: Tue, 30 May 2023 18:24:40 +0200
Subject: [PATCH] qemu: Match NVRAM template extension for new domains
Keep things consistent by using the same file extension for the
generated NVRAM path as the NVRAM template.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit b845e376a45a8e93f933a4a41068a9ce27adf755)
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_firmware.c | 32 ++++++++++++++++---
src/qemu/qemu_firmware.h | 3 +-
src/qemu/qemu_process.c | 2 +-
...-loader-raw-abi-update.aarch64-latest.args | 2 +-
...t-loader-raw-abi-update.aarch64-latest.xml | 2 +-
6 files changed, 33 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 94587638c3..3bb3e5fdfa 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4505,7 +4505,7 @@ qemuDomainDefBootPostParse(virDomainDef *def,
* to start the domain, qemuFirmwareFillDomain() will be run
* again, fail in the same way, and at that point we'll have a
* chance to inform the user of any issues */
- if (qemuFirmwareFillDomain(driver, def) < 0) {
+ if (qemuFirmwareFillDomain(driver, def, abiUpdate) < 0) {
if (abiUpdate) {
return -1;
} else {
diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
index 3538654913..ebaf32cf71 100644
--- a/src/qemu/qemu_firmware.c
+++ b/src/qemu/qemu_firmware.c
@@ -32,6 +32,7 @@
#include "virlog.h"
#include "viralloc.h"
#include "virenum.h"
+#include "virstring.h"
#define VIR_FROM_THIS VIR_FROM_QEMU
@@ -1054,6 +1055,7 @@ qemuFirmwareOSInterfaceTypeFromOsDefLoaderType(virDomainLoader type)
* qemuFirmwareEnsureNVRAM:
* @def: domain definition
* @driver: QEMU driver
+ * @abiUpdate: whether a new domain is being defined
*
* Make sure that a source for the NVRAM file exists, possibly by
* creating it. This might involve automatically generating the
@@ -1061,7 +1063,8 @@ qemuFirmwareOSInterfaceTypeFromOsDefLoaderType(virDomainLoader type)
*/
static void
qemuFirmwareEnsureNVRAM(virDomainDef *def,
- virQEMUDriver *driver)
+ virQEMUDriver *driver,
+ bool abiUpdate)
{
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
virDomainLoaderDef *loader = def->os.loader;
@@ -1091,8 +1094,25 @@ qemuFirmwareEnsureNVRAM(virDomainDef *def,
loader->nvram->type = VIR_STORAGE_TYPE_FILE;
loader->nvram->format = loader->format;
- if (loader->nvram->format == VIR_STORAGE_FILE_RAW)
- ext = ".fd";
+ if (loader->nvram->format == VIR_STORAGE_FILE_RAW) {
+ /* The extension used by raw edk2 builds has historically
+ * been .fd, but more recent aarch64 builds have started
+ * using the .raw extension instead.
+ *
+ * If we're defining a new domain, we should try to match the
+ * extension for the file backing its NVRAM store with the
+ * one used by the template to keep things nice and
+ * consistent.
+ *
+ * If we're loading an existing domain, however, we need to
+ * stick with the .fd extension to ensure compatibility */
+ if (abiUpdate &&
+ loader->nvramTemplate &&
+ virStringHasSuffix(loader->nvramTemplate, ".raw"))
+ ext = ".raw";
+ else
+ ext = ".fd";
+ }
if (loader->nvram->format == VIR_STORAGE_FILE_QCOW2)
ext = ".qcow2";
@@ -1729,6 +1749,7 @@ qemuFirmwareFillDomainModern(virQEMUDriver *driver,
* qemuFirmwareFillDomain:
* @driver: QEMU driver
* @def: domain definition
+ * @abiUpdate: whether a new domain is being defined
*
* Perform firmware selection.
*
@@ -1752,7 +1773,8 @@ qemuFirmwareFillDomainModern(virQEMUDriver *driver,
*/
int
qemuFirmwareFillDomain(virQEMUDriver *driver,
- virDomainDef *def)
+ virDomainDef *def,
+ bool abiUpdate)
{
virDomainLoaderDef *loader = def->os.loader;
virStorageSource *nvram = loader ? loader->nvram : NULL;
@@ -1822,7 +1844,7 @@ qemuFirmwareFillDomain(virQEMUDriver *driver,
/* Always ensure that the NVRAM path is present, even if we
* haven't found a match: the configuration might simply be
* referring to a custom firmware build */
- qemuFirmwareEnsureNVRAM(def, driver);
+ qemuFirmwareEnsureNVRAM(def, driver, abiUpdate);
return 0;
}
diff --git a/src/qemu/qemu_firmware.h b/src/qemu/qemu_firmware.h
index 1ce0920713..39572d979d 100644
--- a/src/qemu/qemu_firmware.h
+++ b/src/qemu/qemu_firmware.h
@@ -44,7 +44,8 @@ qemuFirmwareFetchConfigs(char ***firmwares,
int
qemuFirmwareFillDomain(virQEMUDriver *driver,
- virDomainDef *def);
+ virDomainDef *def,
+ bool abiUpdate);
int
qemuFirmwareGetSupported(const char *machine,
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index db06991450..32fe46dae8 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6706,7 +6706,7 @@ qemuProcessPrepareDomain(virQEMUDriver *driver,
return -1;
VIR_DEBUG("Prepare bios/uefi paths");
- if (qemuFirmwareFillDomain(driver, vm->def) < 0)
+ if (qemuFirmwareFillDomain(driver, vm->def, false) < 0)
return -1;
if (qemuDomainInitializePflashStorageSource(vm, cfg) < 0)
return -1;
diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-format-loader-raw-abi-update.aarch64-latest.args b/tests/qemuxml2argvdata/firmware-auto-efi-format-loader-raw-abi-update.aarch64-latest.args
index eb5cd8d5fc..3e319a29bf 100644
--- a/tests/qemuxml2argvdata/firmware-auto-efi-format-loader-raw-abi-update.aarch64-latest.args
+++ b/tests/qemuxml2argvdata/firmware-auto-efi-format-loader-raw-abi-update.aarch64-latest.args
@@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
-blockdev '{"driver":"file","filename":"/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
--blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/guest_VARS.raw","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
-machine virt-4.0,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format \
-accel tcg \
diff --git a/tests/qemuxml2xmloutdata/firmware-auto-efi-format-loader-raw-abi-update.aarch64-latest.xml b/tests/qemuxml2xmloutdata/firmware-auto-efi-format-loader-raw-abi-update.aarch64-latest.xml
index 38c680fabd..ee22b16831 100644
--- a/tests/qemuxml2xmloutdata/firmware-auto-efi-format-loader-raw-abi-update.aarch64-latest.xml
+++ b/tests/qemuxml2xmloutdata/firmware-auto-efi-format-loader-raw-abi-update.aarch64-latest.xml
@@ -11,7 +11,7 @@
<feature enabled='no' name='secure-boot'/>
</firmware>
<loader readonly='yes' type='pflash'>/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw</loader>
- <nvram template='/usr/share/edk2/aarch64/vars-template-pflash.raw'>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
+ <nvram template='/usr/share/edk2/aarch64/vars-template-pflash.raw'>/var/lib/libvirt/qemu/nvram/guest_VARS.raw</nvram>
<boot dev='hd'/>
</os>
<features>
--
2.42.0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,94 @@
From b0d6ee0778c6c2f49c88de9025f6a398b2d07c0f Mon Sep 17 00:00:00 2001
Message-ID: <b0d6ee0778c6c2f49c88de9025f6a398b2d07c0f.1692951632.git.jdenemar@redhat.com>
From: Andrea Bolognani <abologna@redhat.com>
Date: Tue, 16 May 2023 16:50:37 +0200
Subject: [PATCH] tests: Add some more DO_TEST*ABI_UPDATE* macros
These are going to be useful later.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 87d91e9e242520048579009ce2ddf8b238ec2733)
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
tests/qemuxml2argvtest.c | 19 +++++++++++++++++++
tests/qemuxml2xmltest.c | 3 +++
2 files changed, 22 insertions(+)
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 84e0963ec8..a8711ff833 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -836,6 +836,9 @@ mymain(void)
# define DO_TEST_CAPS_LATEST(name) \
DO_TEST_CAPS_ARCH_LATEST(name, "x86_64")
+# define DO_TEST_CAPS_LATEST_ABI_UPDATE(name) \
+ DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE(name, "x86_64")
+
# define DO_TEST_CAPS_VER(name, ver) \
DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver)
@@ -855,6 +858,11 @@ mymain(void)
DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, \
ARG_FLAGS, FLAG_EXPECT_FAILURE)
+# define DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE_FAILURE(name, arch) \
+ DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, \
+ ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, \
+ ARG_FLAGS, FLAG_EXPECT_FAILURE)
+
# define DO_TEST_CAPS_ARCH_VER_FAILURE(name, arch, ver) \
DO_TEST_CAPS_ARCH_VER_FULL(name, arch, ver, \
ARG_FLAGS, FLAG_EXPECT_FAILURE)
@@ -862,6 +870,9 @@ mymain(void)
# define DO_TEST_CAPS_LATEST_FAILURE(name) \
DO_TEST_CAPS_ARCH_LATEST_FAILURE(name, "x86_64")
+# define DO_TEST_CAPS_LATEST_ABI_UPDATE_FAILURE(name) \
+ DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE_FAILURE(name, "x86_64")
+
# define DO_TEST_CAPS_VER_FAILURE(name, ver) \
DO_TEST_CAPS_ARCH_VER_FAILURE(name, "x86_64", ver)
@@ -869,6 +880,11 @@ mymain(void)
DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, \
ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR)
+# define DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE_PARSE_ERROR(name, arch) \
+ DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, \
+ ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, \
+ ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR)
+
# define DO_TEST_CAPS_ARCH_VER_PARSE_ERROR(name, arch, ver) \
DO_TEST_CAPS_ARCH_VER_FULL(name, arch, ver, \
ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR)
@@ -876,6 +892,9 @@ mymain(void)
# define DO_TEST_CAPS_LATEST_PARSE_ERROR(name) \
DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR(name, "x86_64")
+# define DO_TEST_CAPS_LATEST_ABI_UPDATE_PARSE_ERROR(name) \
+ DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE_PARSE_ERROR(name, "x86_64")
+
# define DO_TEST_CAPS_VER_PARSE_ERROR(name, ver) \
DO_TEST_CAPS_ARCH_VER_PARSE_ERROR(name, "x86_64", ver)
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 6f7f6690bd..5356872ba8 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -184,6 +184,9 @@ mymain(void)
#define DO_TEST_CAPS_LATEST(name) \
DO_TEST_CAPS_ARCH_LATEST(name, "x86_64")
+#define DO_TEST_CAPS_LATEST_ABI_UPDATE(name) \
+ DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE(name, "x86_64")
+
#define DO_TEST_CAPS_VER(name, ver) \
DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver)
--
2.42.0

View File

@ -0,0 +1,104 @@
From 7523f6531ec5cd7e7d77f86b2756ca84d5f87357 Mon Sep 17 00:00:00 2001
Message-ID: <7523f6531ec5cd7e7d77f86b2756ca84d5f87357.1692951632.git.jdenemar@redhat.com>
From: Andrea Bolognani <abologna@redhat.com>
Date: Mon, 15 May 2023 19:04:12 +0200
Subject: [PATCH] tests: Consistently use /path/to/guest_VARS.fd
That's what we already use in almost all cases.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 17735262243293cc68354a06d1042726b2b7293d)
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
.../qemuxml2argvdata/aarch64-virt-graphics.aarch64-latest.args | 2 +-
tests/qemuxml2argvdata/aarch64-virt-graphics.xml | 2 +-
.../qemuxml2argvdata/aarch64-virt-headless.aarch64-latest.args | 2 +-
tests/qemuxml2argvdata/aarch64-virt-headless.xml | 2 +-
.../qemuxml2xmloutdata/aarch64-virt-graphics.aarch64-latest.xml | 2 +-
.../qemuxml2xmloutdata/aarch64-virt-headless.aarch64-latest.xml | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/tests/qemuxml2argvdata/aarch64-virt-graphics.aarch64-latest.args b/tests/qemuxml2argvdata/aarch64-virt-graphics.aarch64-latest.args
index 1b7b0a70ff..eaa558747f 100644
--- a/tests/qemuxml2argvdata/aarch64-virt-graphics.aarch64-latest.args
+++ b/tests/qemuxml2argvdata/aarch64-virt-graphics.aarch64-latest.args
@@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
-blockdev '{"driver":"file","filename":"/usr/share/AAVMF/AAVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
--blockdev '{"driver":"file","filename":"/some/user/nvram/path/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"driver":"file","filename":"/path/to/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
-machine virt-4.0,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format \
-accel tcg \
diff --git a/tests/qemuxml2argvdata/aarch64-virt-graphics.xml b/tests/qemuxml2argvdata/aarch64-virt-graphics.xml
index 2b1704ad7b..3c7da08381 100644
--- a/tests/qemuxml2argvdata/aarch64-virt-graphics.xml
+++ b/tests/qemuxml2argvdata/aarch64-virt-graphics.xml
@@ -12,7 +12,7 @@
<os>
<type arch='aarch64' machine='virt-4.0'>hvm</type>
<loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
- <nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
+ <nvram>/path/to/guest_VARS.fd</nvram>
<boot dev='hd'/>
</os>
<features>
diff --git a/tests/qemuxml2argvdata/aarch64-virt-headless.aarch64-latest.args b/tests/qemuxml2argvdata/aarch64-virt-headless.aarch64-latest.args
index 23b514da9a..9d13abb531 100644
--- a/tests/qemuxml2argvdata/aarch64-virt-headless.aarch64-latest.args
+++ b/tests/qemuxml2argvdata/aarch64-virt-headless.aarch64-latest.args
@@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
-blockdev '{"driver":"file","filename":"/usr/share/AAVMF/AAVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
--blockdev '{"driver":"file","filename":"/some/user/nvram/path/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"driver":"file","filename":"/path/to/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
-machine virt-4.0,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format \
-accel tcg \
diff --git a/tests/qemuxml2argvdata/aarch64-virt-headless.xml b/tests/qemuxml2argvdata/aarch64-virt-headless.xml
index 1d1fc071d7..4cb309037b 100644
--- a/tests/qemuxml2argvdata/aarch64-virt-headless.xml
+++ b/tests/qemuxml2argvdata/aarch64-virt-headless.xml
@@ -12,7 +12,7 @@
<os>
<type arch='aarch64' machine='virt-4.0'>hvm</type>
<loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
- <nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
+ <nvram>/path/to/guest_VARS.fd</nvram>
<boot dev='hd'/>
</os>
<features>
diff --git a/tests/qemuxml2xmloutdata/aarch64-virt-graphics.aarch64-latest.xml b/tests/qemuxml2xmloutdata/aarch64-virt-graphics.aarch64-latest.xml
index f0a4003655..1150aceb02 100644
--- a/tests/qemuxml2xmloutdata/aarch64-virt-graphics.aarch64-latest.xml
+++ b/tests/qemuxml2xmloutdata/aarch64-virt-graphics.aarch64-latest.xml
@@ -16,7 +16,7 @@
<feature enabled='no' name='secure-boot'/>
</firmware>
<loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
- <nvram template='/usr/share/AAVMF/AAVMF_VARS.fd'>/some/user/nvram/path/guest_VARS.fd</nvram>
+ <nvram template='/usr/share/AAVMF/AAVMF_VARS.fd'>/path/to/guest_VARS.fd</nvram>
<boot dev='hd'/>
</os>
<features>
diff --git a/tests/qemuxml2xmloutdata/aarch64-virt-headless.aarch64-latest.xml b/tests/qemuxml2xmloutdata/aarch64-virt-headless.aarch64-latest.xml
index ab4126318a..68df856a28 100644
--- a/tests/qemuxml2xmloutdata/aarch64-virt-headless.aarch64-latest.xml
+++ b/tests/qemuxml2xmloutdata/aarch64-virt-headless.aarch64-latest.xml
@@ -16,7 +16,7 @@
<feature enabled='no' name='secure-boot'/>
</firmware>
<loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
- <nvram template='/usr/share/AAVMF/AAVMF_VARS.fd'>/some/user/nvram/path/guest_VARS.fd</nvram>
+ <nvram template='/usr/share/AAVMF/AAVMF_VARS.fd'>/path/to/guest_VARS.fd</nvram>
<boot dev='hd'/>
</os>
<features>
--
2.42.0

View File

@ -0,0 +1,34 @@
From eda27de700194d435b2ca03d4578f34b5388ecc2 Mon Sep 17 00:00:00 2001
Message-ID: <eda27de700194d435b2ca03d4578f34b5388ecc2.1692951632.git.jdenemar@redhat.com>
From: Andrea Bolognani <abologna@redhat.com>
Date: Mon, 31 Jul 2023 17:05:58 +0200
Subject: [PATCH] tests: Drop tags from BIOS firmware descriptor
They aren't used for anything.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit da6b98394bcce6c128edafb3eefe9570d8b96e84)
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
tests/qemufirmwaredata/usr/share/qemu/firmware/91-bios.json | 3 ---
1 file changed, 3 deletions(-)
diff --git a/tests/qemufirmwaredata/usr/share/qemu/firmware/91-bios.json b/tests/qemufirmwaredata/usr/share/qemu/firmware/91-bios.json
index 137ff70779..378e6d93a5 100644
--- a/tests/qemufirmwaredata/usr/share/qemu/firmware/91-bios.json
+++ b/tests/qemufirmwaredata/usr/share/qemu/firmware/91-bios.json
@@ -28,8 +28,5 @@
"acpi-s4"
],
"tags": [
- "CONFIG_BOOTSPLASH=n",
- "CONFIG_ROM_SIZE=256",
- "CONFIG_USE_SMM=n"
]
}
--
2.42.0

View File

@ -0,0 +1,36 @@
From a6233b1853d1090e7387ab6dea3cb4e46f1bbe0f Mon Sep 17 00:00:00 2001
Message-ID: <a6233b1853d1090e7387ab6dea3cb4e46f1bbe0f.1692951632.git.jdenemar@redhat.com>
From: Andrea Bolognani <abologna@redhat.com>
Date: Thu, 18 May 2023 14:57:07 +0200
Subject: [PATCH] tests: Include microvm in firmwaretest
libvirt doesn't really support the microvm machine type, but
it can parse the firmware descriptor just fine.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 1b3e9c67e3a2902b882ac2310f4876f5fa48d8f7)
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
tests/qemufirmwaretest.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/qemufirmwaretest.c b/tests/qemufirmwaretest.c
index 86c708c7ac..7596c746ab 100644
--- a/tests/qemufirmwaretest.c
+++ b/tests/qemufirmwaretest.c
@@ -295,6 +295,9 @@ mymain(void)
DO_SUPPORTED_TEST("pc-q35-3.1", VIR_ARCH_I686, false,
"/usr/share/seabios/bios-256k.bin:NULL",
VIR_DOMAIN_OS_DEF_FIRMWARE_BIOS);
+ DO_SUPPORTED_TEST("microvm", VIR_ARCH_X86_64, false,
+ "/usr/share/edk2/ovmf/MICROVM.fd:NULL",
+ VIR_DOMAIN_OS_DEF_FIRMWARE_EFI);
DO_SUPPORTED_TEST("virt-3.1", VIR_ARCH_AARCH64, false,
"/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.qcow2:/usr/share/edk2/aarch64/vars-template-pflash.qcow2:"
"/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw:/usr/share/edk2/aarch64/vars-template-pflash.raw:"
--
2.42.0

View File

@ -0,0 +1,70 @@
From 7673738e37d6cb0953b3d338fa8e05a09247a389 Mon Sep 17 00:00:00 2001
Message-ID: <7673738e37d6cb0953b3d338fa8e05a09247a389.1692951632.git.jdenemar@redhat.com>
From: Andrea Bolognani <abologna@redhat.com>
Date: Thu, 3 Aug 2023 15:22:10 +0200
Subject: [PATCH] tests: Reintroduce firmware-auto-efi-format-mismatch
Since the previous version of this negative test now passes,
create a new version that still triggers the intended failure.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 7c328b6cf48b4b75c0964bc127aaafb640ea944c)
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
...auto-efi-format-mismatch.x86_64-latest.err | 1 +
.../firmware-auto-efi-format-mismatch.xml | 19 +++++++++++++++++++
tests/qemuxml2argvtest.c | 1 +
3 files changed, 21 insertions(+)
create mode 100644 tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.x86_64-latest.err
create mode 100644 tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.xml
diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.x86_64-latest.err b/tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.x86_64-latest.err
new file mode 100644
index 0000000000..abfdfc4357
--- /dev/null
+++ b/tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.x86_64-latest.err
@@ -0,0 +1 @@
+XML error: Format mismatch: loader.format='qcow2' nvram.format='raw'
diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.xml b/tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.xml
new file mode 100644
index 0000000000..4af77c3bee
--- /dev/null
+++ b/tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.xml
@@ -0,0 +1,19 @@
+<domain type='kvm'>
+ <name>guest</name>
+ <uuid>63840878-0deb-4095-97e6-fc444d9bc9fa</uuid>
+ <memory unit='KiB'>1048576</memory>
+ <vcpu placement='static'>1</vcpu>
+ <os firmware='efi'>
+ <type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
+ <loader format='qcow2'/>
+ <nvram format='raw'/>
+ </os>
+ <features>
+ <acpi/>
+ </features>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <controller type='usb' model='none'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index cc3345f5b1..37ae14d61b 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1118,6 +1118,7 @@ mymain(void)
DO_TEST_CAPS_LATEST("firmware-auto-efi-format-nvram-qcow2-network-nbd");
DO_TEST_CAPS_ARCH_LATEST("firmware-auto-efi-format-loader-raw", "aarch64");
DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("firmware-auto-efi-format-loader-raw-abi-update", "aarch64");
+ DO_TEST_CAPS_LATEST_PARSE_ERROR("firmware-auto-efi-format-mismatch");
DO_TEST_NOCAPS("clock-utc");
DO_TEST_NOCAPS("clock-localtime");
--
2.42.0

View File

@ -0,0 +1,117 @@
From b262d1dfbdbc8bb6c57bf4f6053dada37691ceab Mon Sep 17 00:00:00 2001
Message-ID: <b262d1dfbdbc8bb6c57bf4f6053dada37691ceab.1692951632.git.jdenemar@redhat.com>
From: Andrea Bolognani <abologna@redhat.com>
Date: Thu, 3 Aug 2023 15:19:59 +0200
Subject: [PATCH] tests: Rename
firmware-auto-efi-format-loader-qcow2-nvram-path
Now that, after the recent changes, the test passes, its old
name is no longer accurate.
While at it, enable the xml2xml part for it as well.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 48e5fe7af43b291e98a6c57cb8830e0adff49d6f)
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
...oader-qcow2-nvram-path.x86_64-latest.args} | 0
...to-efi-format-loader-qcow2-nvram-path.xml} | 0
tests/qemuxml2argvtest.c | 2 +-
...-loader-qcow2-nvram-path.x86_64-latest.xml | 41 +++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
5 files changed, 43 insertions(+), 1 deletion(-)
rename tests/qemuxml2argvdata/{firmware-auto-efi-format-mismatch.x86_64-latest.args => firmware-auto-efi-format-loader-qcow2-nvram-path.x86_64-latest.args} (100%)
rename tests/qemuxml2argvdata/{firmware-auto-efi-format-mismatch.xml => firmware-auto-efi-format-loader-qcow2-nvram-path.xml} (100%)
create mode 100644 tests/qemuxml2xmloutdata/firmware-auto-efi-format-loader-qcow2-nvram-path.x86_64-latest.xml
diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.x86_64-latest.args b/tests/qemuxml2argvdata/firmware-auto-efi-format-loader-qcow2-nvram-path.x86_64-latest.args
similarity index 100%
rename from tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.x86_64-latest.args
rename to tests/qemuxml2argvdata/firmware-auto-efi-format-loader-qcow2-nvram-path.x86_64-latest.args
diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.xml b/tests/qemuxml2argvdata/firmware-auto-efi-format-loader-qcow2-nvram-path.xml
similarity index 100%
rename from tests/qemuxml2argvdata/firmware-auto-efi-format-mismatch.xml
rename to tests/qemuxml2argvdata/firmware-auto-efi-format-loader-qcow2-nvram-path.xml
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 9439a5a1e6..cc3345f5b1 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1112,12 +1112,12 @@ mymain(void)
DO_TEST_CAPS_LATEST("firmware-auto-efi-nvram-network-iscsi");
DO_TEST_CAPS_LATEST("firmware-auto-efi-format-loader-qcow2");
+ DO_TEST_CAPS_LATEST("firmware-auto-efi-format-loader-qcow2-nvram-path");
DO_TEST_CAPS_LATEST("firmware-auto-efi-format-nvram-qcow2");
DO_TEST_CAPS_LATEST("firmware-auto-efi-format-nvram-qcow2-path");
DO_TEST_CAPS_LATEST("firmware-auto-efi-format-nvram-qcow2-network-nbd");
DO_TEST_CAPS_ARCH_LATEST("firmware-auto-efi-format-loader-raw", "aarch64");
DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("firmware-auto-efi-format-loader-raw-abi-update", "aarch64");
- DO_TEST_CAPS_LATEST("firmware-auto-efi-format-mismatch");
DO_TEST_NOCAPS("clock-utc");
DO_TEST_NOCAPS("clock-localtime");
diff --git a/tests/qemuxml2xmloutdata/firmware-auto-efi-format-loader-qcow2-nvram-path.x86_64-latest.xml b/tests/qemuxml2xmloutdata/firmware-auto-efi-format-loader-qcow2-nvram-path.x86_64-latest.xml
new file mode 100644
index 0000000000..49fdfc5c5f
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/firmware-auto-efi-format-loader-qcow2-nvram-path.x86_64-latest.xml
@@ -0,0 +1,41 @@
+<domain type='kvm'>
+ <name>guest</name>
+ <uuid>63840878-0deb-4095-97e6-fc444d9bc9fa</uuid>
+ <memory unit='KiB'>1048576</memory>
+ <currentMemory unit='KiB'>1048576</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os firmware='efi'>
+ <type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
+ <firmware>
+ <feature enabled='yes' name='enrolled-keys'/>
+ <feature enabled='yes' name='secure-boot'/>
+ </firmware>
+ <loader readonly='yes' secure='yes' type='pflash' format='qcow2'>/usr/share/edk2/ovmf/OVMF_CODE_4M.secboot.qcow2</loader>
+ <nvram template='/usr/share/edk2/ovmf/OVMF_VARS_4M.secboot.qcow2' format='qcow2'>/path/to/guest_VARS.qcow2</nvram>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <smm state='on'/>
+ </features>
+ <cpu mode='custom' match='exact' check='none'>
+ <model fallback='forbid'>qemu64</model>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <controller type='usb' index='0' model='none'/>
+ <controller type='sata' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pcie-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='none'/>
+ <watchdog model='itco' action='reset'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 3f2ef10df7..c210673e39 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -921,6 +921,7 @@ mymain(void)
DO_TEST_CAPS_LATEST("firmware-auto-efi-nvram-network-iscsi");
DO_TEST_CAPS_LATEST("firmware-auto-efi-format-loader-qcow2");
+ DO_TEST_CAPS_LATEST("firmware-auto-efi-format-loader-qcow2-nvram-path");
DO_TEST_CAPS_LATEST("firmware-auto-efi-format-nvram-qcow2");
DO_TEST_CAPS_LATEST("firmware-auto-efi-format-nvram-qcow2-path");
DO_TEST_CAPS_LATEST("firmware-auto-efi-format-nvram-qcow2-network-nbd");
--
2.42.0

View File

@ -0,0 +1,81 @@
From f8725c0f60e94a393fc731f323bbdfdbaa35dd02 Mon Sep 17 00:00:00 2001
Message-ID: <f8725c0f60e94a393fc731f323bbdfdbaa35dd02.1692951632.git.jdenemar@redhat.com>
From: Andrea Bolognani <abologna@redhat.com>
Date: Fri, 26 May 2023 18:16:24 +0200
Subject: [PATCH] tests: Rename firmware-auto-efi-nvram-path
The new name better describes the test scenario and will fit
better with the additional tests that we're about to introduce.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 4ba04107d9ebc0070f64a031673cef61a5947866)
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
...est.args => firmware-auto-efi-nvram-path.x86_64-latest.args} | 0
...ware-auto-efi-nvram.xml => firmware-auto-efi-nvram-path.xml} | 0
tests/qemuxml2argvtest.c | 2 +-
...atest.xml => firmware-auto-efi-nvram-path.x86_64-latest.xml} | 0
tests/qemuxml2xmltest.c | 2 +-
5 files changed, 2 insertions(+), 2 deletions(-)
rename tests/qemuxml2argvdata/{firmware-auto-efi-nvram.x86_64-latest.args => firmware-auto-efi-nvram-path.x86_64-latest.args} (100%)
rename tests/qemuxml2argvdata/{firmware-auto-efi-nvram.xml => firmware-auto-efi-nvram-path.xml} (100%)
rename tests/qemuxml2xmloutdata/{firmware-auto-efi-nvram.x86_64-latest.xml => firmware-auto-efi-nvram-path.x86_64-latest.xml} (100%)
diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-nvram.x86_64-latest.args b/tests/qemuxml2argvdata/firmware-auto-efi-nvram-path.x86_64-latest.args
similarity index 100%
rename from tests/qemuxml2argvdata/firmware-auto-efi-nvram.x86_64-latest.args
rename to tests/qemuxml2argvdata/firmware-auto-efi-nvram-path.x86_64-latest.args
diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-nvram.xml b/tests/qemuxml2argvdata/firmware-auto-efi-nvram-path.xml
similarity index 100%
rename from tests/qemuxml2argvdata/firmware-auto-efi-nvram.xml
rename to tests/qemuxml2argvdata/firmware-auto-efi-nvram-path.xml
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 549ecdf9ce..84e0963ec8 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1059,7 +1059,6 @@ mymain(void)
DO_TEST_CAPS_LATEST_PARSE_ERROR("firmware-auto-bios-nvram");
DO_TEST_CAPS_LATEST("firmware-auto-efi");
DO_TEST_CAPS_LATEST("firmware-auto-efi-stateless");
- DO_TEST_CAPS_LATEST("firmware-auto-efi-nvram");
DO_TEST_CAPS_LATEST("firmware-auto-efi-loader-secure");
DO_TEST_CAPS_LATEST("firmware-auto-efi-loader-insecure");
DO_TEST_CAPS_LATEST("firmware-auto-efi-loader-path");
@@ -1072,6 +1071,7 @@ mymain(void)
DO_TEST_CAPS_LATEST("firmware-auto-efi-smm-off");
DO_TEST_CAPS_ARCH_LATEST("firmware-auto-efi-aarch64", "aarch64");
DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("firmware-auto-efi-abi-update-aarch64", "aarch64");
+ DO_TEST_CAPS_LATEST("firmware-auto-efi-nvram-path");
DO_TEST_CAPS_LATEST("firmware-auto-efi-nvram-file");
DO_TEST_CAPS_LATEST("firmware-auto-efi-nvram-network-nbd");
DO_TEST_CAPS_LATEST("firmware-auto-efi-nvram-network-iscsi");
diff --git a/tests/qemuxml2xmloutdata/firmware-auto-efi-nvram.x86_64-latest.xml b/tests/qemuxml2xmloutdata/firmware-auto-efi-nvram-path.x86_64-latest.xml
similarity index 100%
rename from tests/qemuxml2xmloutdata/firmware-auto-efi-nvram.x86_64-latest.xml
rename to tests/qemuxml2xmloutdata/firmware-auto-efi-nvram-path.x86_64-latest.xml
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 74e6a27b73..6f7f6690bd 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -886,7 +886,6 @@ mymain(void)
DO_TEST_CAPS_LATEST("firmware-auto-bios-stateless");
DO_TEST_CAPS_LATEST("firmware-auto-efi");
DO_TEST_CAPS_LATEST("firmware-auto-efi-stateless");
- DO_TEST_CAPS_LATEST("firmware-auto-efi-nvram");
DO_TEST_CAPS_LATEST("firmware-auto-efi-loader-secure");
DO_TEST_CAPS_LATEST("firmware-auto-efi-loader-insecure");
DO_TEST_CAPS_LATEST("firmware-auto-efi-loader-path");
@@ -898,6 +897,7 @@ mymain(void)
DO_TEST_CAPS_LATEST("firmware-auto-efi-smm-off");
DO_TEST_CAPS_ARCH_LATEST("firmware-auto-efi-aarch64", "aarch64");
DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("firmware-auto-efi-abi-update-aarch64", "aarch64");
+ DO_TEST_CAPS_LATEST("firmware-auto-efi-nvram-path");
DO_TEST_CAPS_LATEST("firmware-auto-efi-nvram-file");
DO_TEST_CAPS_LATEST("firmware-auto-efi-nvram-network-nbd");
DO_TEST_CAPS_LATEST("firmware-auto-efi-nvram-network-iscsi");
--
2.42.0

View File

@ -0,0 +1,148 @@
From 5f3f84811feda3b30d9f5e3d99c629169b8ba39c Mon Sep 17 00:00:00 2001
Message-ID: <5f3f84811feda3b30d9f5e3d99c629169b8ba39c.1692951632.git.jdenemar@redhat.com>
From: Andrea Bolognani <abologna@redhat.com>
Date: Mon, 15 May 2023 18:42:27 +0200
Subject: [PATCH] tests: Switch to firmware autoselection for hvf
Firmware selection is not relevant to these tests, so adopt
the most convenient approach.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 8c326914d8fc49c838650aef3432e0669cbd8fe1)
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
.../hvf-aarch64-virt-headless.aarch64-latest.args | 6 +++---
tests/qemuxml2argvdata/hvf-aarch64-virt-headless.xml | 6 ++----
.../hvf-x86_64-q35-headless.x86_64-latest.args | 7 ++++++-
tests/qemuxml2argvdata/hvf-x86_64-q35-headless.xml | 4 ++--
.../hvf-aarch64-virt-headless.aarch64-latest.xml | 12 ++++++++----
.../hvf-x86_64-q35-headless.x86_64-latest.xml | 11 +++++++++--
6 files changed, 30 insertions(+), 16 deletions(-)
diff --git a/tests/qemuxml2argvdata/hvf-aarch64-virt-headless.aarch64-latest.args b/tests/qemuxml2argvdata/hvf-aarch64-virt-headless.aarch64-latest.args
index 8fae9ebfa6..7559b9885f 100644
--- a/tests/qemuxml2argvdata/hvf-aarch64-virt-headless.aarch64-latest.args
+++ b/tests/qemuxml2argvdata/hvf-aarch64-virt-headless.aarch64-latest.args
@@ -10,11 +10,11 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \
-name guest=test,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \
--blockdev '{"driver":"file","filename":"/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"driver":"file","filename":"/usr/share/AAVMF/AAVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
--blockdev '{"driver":"file","filename":"/some/user/nvram/path/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/test_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
--machine virt,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format \
+-machine virt-4.0,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format \
-accel hvf \
-m size=4194304k \
-object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":4294967296}' \
diff --git a/tests/qemuxml2argvdata/hvf-aarch64-virt-headless.xml b/tests/qemuxml2argvdata/hvf-aarch64-virt-headless.xml
index 01997b9731..3ae6f93647 100644
--- a/tests/qemuxml2argvdata/hvf-aarch64-virt-headless.xml
+++ b/tests/qemuxml2argvdata/hvf-aarch64-virt-headless.xml
@@ -4,10 +4,8 @@
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='static'>2</vcpu>
- <os>
- <type arch='aarch64' machine='virt'>hvm</type>
- <loader readonly='yes' type='pflash'>/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw</loader>
- <nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
+ <os firmware='efi'>
+ <type arch='aarch64' machine='virt-4.0'>hvm</type>
<boot dev='hd'/>
</os>
<features>
diff --git a/tests/qemuxml2argvdata/hvf-x86_64-q35-headless.x86_64-latest.args b/tests/qemuxml2argvdata/hvf-x86_64-q35-headless.x86_64-latest.args
index 92fbcffd57..abea7bf158 100644
--- a/tests/qemuxml2argvdata/hvf-x86_64-q35-headless.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/hvf-x86_64-q35-headless.x86_64-latest.args
@@ -10,9 +10,14 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \
-name guest=test,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \
--machine q35,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-blockdev '{"driver":"file","filename":"/usr/share/OVMF/OVMF_CODE.secboot.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
+-blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/test_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
+-machine pc-q35-4.0,usb=off,smm=on,dump-guest-core=off,memory-backend=pc.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format \
-accel hvf \
-cpu qemu64 \
+-global driver=cfi.pflash01,property=secure,value=on \
-m size=4194304k \
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":4294967296}' \
-overcommit mem-lock=off \
diff --git a/tests/qemuxml2argvdata/hvf-x86_64-q35-headless.xml b/tests/qemuxml2argvdata/hvf-x86_64-q35-headless.xml
index cad560e9ca..93980d434c 100644
--- a/tests/qemuxml2argvdata/hvf-x86_64-q35-headless.xml
+++ b/tests/qemuxml2argvdata/hvf-x86_64-q35-headless.xml
@@ -4,8 +4,8 @@
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='static'>2</vcpu>
- <os>
- <type arch='x86_64' machine='q35'>hvm</type>
+ <os firmware='efi'>
+ <type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
<boot dev='hd'/>
</os>
<features>
diff --git a/tests/qemuxml2xmloutdata/hvf-aarch64-virt-headless.aarch64-latest.xml b/tests/qemuxml2xmloutdata/hvf-aarch64-virt-headless.aarch64-latest.xml
index 16e8c23a79..69c1d5deb3 100644
--- a/tests/qemuxml2xmloutdata/hvf-aarch64-virt-headless.aarch64-latest.xml
+++ b/tests/qemuxml2xmloutdata/hvf-aarch64-virt-headless.aarch64-latest.xml
@@ -4,10 +4,14 @@
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='static'>2</vcpu>
- <os>
- <type arch='aarch64' machine='virt'>hvm</type>
- <loader readonly='yes' type='pflash'>/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw</loader>
- <nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
+ <os firmware='efi'>
+ <type arch='aarch64' machine='virt-4.0'>hvm</type>
+ <firmware>
+ <feature enabled='no' name='enrolled-keys'/>
+ <feature enabled='no' name='secure-boot'/>
+ </firmware>
+ <loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
+ <nvram template='/usr/share/AAVMF/AAVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/test_VARS.fd</nvram>
<boot dev='hd'/>
</os>
<features>
diff --git a/tests/qemuxml2xmloutdata/hvf-x86_64-q35-headless.x86_64-latest.xml b/tests/qemuxml2xmloutdata/hvf-x86_64-q35-headless.x86_64-latest.xml
index 384241ac3d..032fd43471 100644
--- a/tests/qemuxml2xmloutdata/hvf-x86_64-q35-headless.x86_64-latest.xml
+++ b/tests/qemuxml2xmloutdata/hvf-x86_64-q35-headless.x86_64-latest.xml
@@ -4,13 +4,20 @@
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='static'>2</vcpu>
- <os>
- <type arch='x86_64' machine='q35'>hvm</type>
+ <os firmware='efi'>
+ <type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
+ <firmware>
+ <feature enabled='yes' name='enrolled-keys'/>
+ <feature enabled='yes' name='secure-boot'/>
+ </firmware>
+ <loader readonly='yes' secure='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.secboot.fd</loader>
+ <nvram template='/usr/share/OVMF/OVMF_VARS.secboot.fd'>/var/lib/libvirt/qemu/nvram/test_VARS.fd</nvram>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
+ <smm state='on'/>
</features>
<cpu mode='custom' match='exact' check='none'>
<model fallback='forbid'>qemu64</model>
--
2.42.0

View File

@ -0,0 +1,57 @@
From 57b899e51b68ec5e9a78a90f9c1a06c572d9f5c7 Mon Sep 17 00:00:00 2001
Message-ID: <57b899e51b68ec5e9a78a90f9c1a06c572d9f5c7.1692951632.git.jdenemar@redhat.com>
From: Andrea Bolognani <abologna@redhat.com>
Date: Tue, 16 May 2023 16:55:41 +0200
Subject: [PATCH] tests: Turn abi-update.xml into a symlink
Since the idea behind introducing the abi-update variant of
a test is showing that libvirt behaves differently based on
whether the configuration is for a newly-defined domain or an
existing one, we don't want the input files to ever go out of
sync.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 8627ec167cb29bc4bea7609992670c0a718e8c79)
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
.../firmware-auto-efi-abi-update-aarch64.xml | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)
mode change 100644 => 120000 tests/qemuxml2argvdata/firmware-auto-efi-abi-update-aarch64.xml
diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-abi-update-aarch64.xml b/tests/qemuxml2argvdata/firmware-auto-efi-abi-update-aarch64.xml
deleted file mode 100644
index 5c6c5192ba..0000000000
--- a/tests/qemuxml2argvdata/firmware-auto-efi-abi-update-aarch64.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<domain type='qemu'>
- <name>guest</name>
- <uuid>63840878-0deb-4095-97e6-fc444d9bc9fa</uuid>
- <memory unit='KiB'>1048576</memory>
- <vcpu placement='static'>1</vcpu>
- <os firmware='efi'>
- <type arch='aarch64' machine='virt-4.0'>hvm</type>
- </os>
- <features>
- <acpi/>
- </features>
- <devices>
- <emulator>/usr/bin/qemu-system-aarch64</emulator>
- <controller type='usb' model='none'/>
- <memballoon model='none'/>
- </devices>
-</domain>
diff --git a/tests/qemuxml2argvdata/firmware-auto-efi-abi-update-aarch64.xml b/tests/qemuxml2argvdata/firmware-auto-efi-abi-update-aarch64.xml
new file mode 120000
index 0000000000..551082260a
--- /dev/null
+++ b/tests/qemuxml2argvdata/firmware-auto-efi-abi-update-aarch64.xml
@@ -0,0 +1 @@
+firmware-auto-efi-aarch64.xml
\ No newline at end of file
--
2.42.0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,119 @@
From 38b7b94f3b0571d4411e858a17232626499f1e45 Mon Sep 17 00:00:00 2001
Message-ID: <38b7b94f3b0571d4411e858a17232626499f1e45.1692951632.git.jdenemar@redhat.com>
From: Andrea Bolognani <abologna@redhat.com>
Date: Tue, 30 May 2023 17:48:58 +0200
Subject: [PATCH] tests: Use DO_TEST_CAPS_*_ABI_UPDATE() for ppc64
We have a number of tests that can benefit from this macro
instead of open-coding it.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 751b0e6dbfba160dac8dead6c6e6c68660e0a706)
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
...lug-nvdimm-ppc64-abi-update.ppc64-latest.args} | 0
...lug-ppc64-nonuma-abi-update.ppc64-latest.args} | 0
...64-usb-controller-qemu-xhci.ppc64-latest.args} | 0
tests/qemuxml2argvtest.c | 15 +++------------
...plug-nvdimm-ppc64-abi-update.ppc64-latest.xml} | 0
...plug-ppc64-nonuma-abi-update.ppc64-latest.xml} | 0
tests/qemuxml2xmltest.c | 8 ++------
7 files changed, 5 insertions(+), 18 deletions(-)
rename tests/qemuxml2argvdata/{memory-hotplug-nvdimm-ppc64-abi-update.args => memory-hotplug-nvdimm-ppc64-abi-update.ppc64-latest.args} (100%)
rename tests/qemuxml2argvdata/{memory-hotplug-ppc64-nonuma-abi-update.args => memory-hotplug-ppc64-nonuma-abi-update.ppc64-latest.args} (100%)
rename tests/qemuxml2argvdata/{ppc64-usb-controller-qemu-xhci.args => ppc64-usb-controller-qemu-xhci.ppc64-latest.args} (100%)
rename tests/qemuxml2xmloutdata/{memory-hotplug-nvdimm-ppc64-abi-update.xml => memory-hotplug-nvdimm-ppc64-abi-update.ppc64-latest.xml} (100%)
rename tests/qemuxml2xmloutdata/{memory-hotplug-ppc64-nonuma-abi-update.xml => memory-hotplug-ppc64-nonuma-abi-update.ppc64-latest.xml} (100%)
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64-abi-update.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64-abi-update.ppc64-latest.args
similarity index 100%
rename from tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64-abi-update.args
rename to tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64-abi-update.ppc64-latest.args
diff --git a/tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma-abi-update.args b/tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma-abi-update.ppc64-latest.args
similarity index 100%
rename from tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma-abi-update.args
rename to tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma-abi-update.ppc64-latest.args
diff --git a/tests/qemuxml2argvdata/ppc64-usb-controller-qemu-xhci.args b/tests/qemuxml2argvdata/ppc64-usb-controller-qemu-xhci.ppc64-latest.args
similarity index 100%
rename from tests/qemuxml2argvdata/ppc64-usb-controller-qemu-xhci.args
rename to tests/qemuxml2argvdata/ppc64-usb-controller-qemu-xhci.ppc64-latest.args
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 9abaa72674..549ecdf9ce 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2440,10 +2440,7 @@ mymain(void)
DO_TEST("memory-hotplug-dimm", QEMU_CAPS_DEVICE_PC_DIMM);
DO_TEST_CAPS_LATEST("memory-hotplug-dimm-addr");
DO_TEST_CAPS_ARCH_LATEST("memory-hotplug-ppc64-nonuma", "ppc64");
- DO_TEST_FULL("memory-hotplug-ppc64-nonuma-abi-update", "",
- ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE,
- ARG_CAPS_ARCH, "ppc64", ARG_CAPS_VER, "latest",
- ARG_END);
+ DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("memory-hotplug-ppc64-nonuma-abi-update", "ppc64");
DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm");
DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-access");
DO_TEST_CAPS_VER("memory-hotplug-nvdimm-label", "5.2.0");
@@ -2455,10 +2452,7 @@ mymain(void)
DO_TEST_CAPS_VER("memory-hotplug-nvdimm-readonly", "5.2.0");
DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-readonly");
DO_TEST_CAPS_ARCH_LATEST("memory-hotplug-nvdimm-ppc64", "ppc64");
- DO_TEST_FULL("memory-hotplug-nvdimm-ppc64-abi-update", "",
- ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE,
- ARG_CAPS_ARCH, "ppc64", ARG_CAPS_VER, "latest",
- ARG_END);
+ DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("memory-hotplug-nvdimm-ppc64-abi-update", "ppc64");
DO_TEST_CAPS_VER("memory-hotplug-virtio-pmem", "5.2.0");
DO_TEST_CAPS_LATEST("memory-hotplug-virtio-pmem");
DO_TEST_CAPS_LATEST("memory-hotplug-virtio-mem");
@@ -2497,10 +2491,7 @@ mymain(void)
DO_TEST_CAPS_ARCH_LATEST("ppc64-usb-controller", "ppc64");
DO_TEST_CAPS_ARCH_LATEST("ppc64-usb-controller-legacy", "ppc64");
- DO_TEST_FULL("ppc64-usb-controller-qemu-xhci", "",
- ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE,
- ARG_CAPS_ARCH, "ppc64", ARG_CAPS_VER, "latest",
- ARG_END);
+ DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("ppc64-usb-controller-qemu-xhci", "ppc64");
DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("ppc64-tpmproxy-double", "ppc64");
DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("ppc64-tpm-double", "ppc64");
diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64-abi-update.xml b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64-abi-update.ppc64-latest.xml
similarity index 100%
rename from tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64-abi-update.xml
rename to tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64-abi-update.ppc64-latest.xml
diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-ppc64-nonuma-abi-update.xml b/tests/qemuxml2xmloutdata/memory-hotplug-ppc64-nonuma-abi-update.ppc64-latest.xml
similarity index 100%
rename from tests/qemuxml2xmloutdata/memory-hotplug-ppc64-nonuma-abi-update.xml
rename to tests/qemuxml2xmloutdata/memory-hotplug-ppc64-nonuma-abi-update.ppc64-latest.xml
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index b66274beb8..74e6a27b73 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -995,9 +995,7 @@ mymain(void)
DO_TEST_CAPS_ARCH_LATEST("aarch64-usb-controller", "aarch64");
DO_TEST_CAPS_ARCH_LATEST("memory-hotplug-ppc64-nonuma", "ppc64");
- DO_TEST_FULL("memory-hotplug-ppc64-nonuma-abi-update", "", WHEN_BOTH,
- ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE,
- ARG_CAPS_ARCH, "ppc64", ARG_CAPS_VER, "latest", ARG_END);
+ DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("memory-hotplug-ppc64-nonuma-abi-update", "ppc64");
DO_TEST_NOCAPS("memory-hotplug");
DO_TEST("memory-hotplug-dimm", QEMU_CAPS_DEVICE_PC_DIMM);
DO_TEST_CAPS_LATEST("memory-hotplug-dimm-addr");
@@ -1009,9 +1007,7 @@ mymain(void)
DO_TEST("memory-hotplug-nvdimm-readonly", QEMU_CAPS_DEVICE_NVDIMM,
QEMU_CAPS_DEVICE_NVDIMM_UNARMED);
DO_TEST_CAPS_ARCH_LATEST("memory-hotplug-nvdimm-ppc64", "ppc64");
- DO_TEST_FULL("memory-hotplug-nvdimm-ppc64-abi-update", "", WHEN_BOTH,
- ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE,
- ARG_CAPS_ARCH, "ppc64", ARG_CAPS_VER, "latest", ARG_END);
+ DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE("memory-hotplug-nvdimm-ppc64-abi-update", "ppc64");
DO_TEST_CAPS_LATEST("memory-hotplug-virtio-pmem");
DO_TEST_CAPS_LATEST("memory-hotplug-virtio-mem");
DO_TEST_CAPS_LATEST("memory-hotplug-multiple");
--
2.42.0

View File

@ -0,0 +1,118 @@
From f3437c2d4bce7b21f199cdc59bb6778e49507f5b Mon Sep 17 00:00:00 2001
Message-ID: <f3437c2d4bce7b21f199cdc59bb6778e49507f5b.1692951632.git.jdenemar@redhat.com>
From: Andrea Bolognani <abologna@redhat.com>
Date: Mon, 15 May 2023 18:39:18 +0200
Subject: [PATCH] tests: Use virt-4.0 machine type for aarch64
Using the unversioned machine type means that firmware
descriptors can't be used to discover additional information
about the chosen firmware build.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 5c129c8e7a15650fcb0deac53d9d3c0ac1802da5)
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
.../aarch64-virt-graphics.aarch64-latest.args | 2 +-
tests/qemuxml2argvdata/aarch64-virt-graphics.xml | 2 +-
.../aarch64-virt-headless.aarch64-latest.args | 2 +-
tests/qemuxml2argvdata/aarch64-virt-headless.xml | 2 +-
.../aarch64-virt-graphics.aarch64-latest.xml | 8 ++++++--
.../aarch64-virt-headless.aarch64-latest.xml | 8 ++++++--
6 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/tests/qemuxml2argvdata/aarch64-virt-graphics.aarch64-latest.args b/tests/qemuxml2argvdata/aarch64-virt-graphics.aarch64-latest.args
index 2c07824346..1b7b0a70ff 100644
--- a/tests/qemuxml2argvdata/aarch64-virt-graphics.aarch64-latest.args
+++ b/tests/qemuxml2argvdata/aarch64-virt-graphics.aarch64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
-blockdev '{"driver":"file","filename":"/some/user/nvram/path/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
--machine virt,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format \
+-machine virt-4.0,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format \
-accel tcg \
-cpu cortex-a15 \
-m size=4194304k \
diff --git a/tests/qemuxml2argvdata/aarch64-virt-graphics.xml b/tests/qemuxml2argvdata/aarch64-virt-graphics.xml
index b1b5e87c22..2b1704ad7b 100644
--- a/tests/qemuxml2argvdata/aarch64-virt-graphics.xml
+++ b/tests/qemuxml2argvdata/aarch64-virt-graphics.xml
@@ -10,7 +10,7 @@
<currentMemory>4194304</currentMemory>
<vcpu>4</vcpu>
<os>
- <type arch='aarch64' machine='virt'>hvm</type>
+ <type arch='aarch64' machine='virt-4.0'>hvm</type>
<loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
<boot dev='hd'/>
diff --git a/tests/qemuxml2argvdata/aarch64-virt-headless.aarch64-latest.args b/tests/qemuxml2argvdata/aarch64-virt-headless.aarch64-latest.args
index 734e62ed53..23b514da9a 100644
--- a/tests/qemuxml2argvdata/aarch64-virt-headless.aarch64-latest.args
+++ b/tests/qemuxml2argvdata/aarch64-virt-headless.aarch64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
-blockdev '{"driver":"file","filename":"/some/user/nvram/path/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
--machine virt,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format \
+-machine virt-4.0,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format \
-accel tcg \
-cpu cortex-a15 \
-m size=4194304k \
diff --git a/tests/qemuxml2argvdata/aarch64-virt-headless.xml b/tests/qemuxml2argvdata/aarch64-virt-headless.xml
index 27825e9a55..1d1fc071d7 100644
--- a/tests/qemuxml2argvdata/aarch64-virt-headless.xml
+++ b/tests/qemuxml2argvdata/aarch64-virt-headless.xml
@@ -10,7 +10,7 @@
<currentMemory>4194304</currentMemory>
<vcpu>4</vcpu>
<os>
- <type arch='aarch64' machine='virt'>hvm</type>
+ <type arch='aarch64' machine='virt-4.0'>hvm</type>
<loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
<boot dev='hd'/>
diff --git a/tests/qemuxml2xmloutdata/aarch64-virt-graphics.aarch64-latest.xml b/tests/qemuxml2xmloutdata/aarch64-virt-graphics.aarch64-latest.xml
index 24109a11c3..f0a4003655 100644
--- a/tests/qemuxml2xmloutdata/aarch64-virt-graphics.aarch64-latest.xml
+++ b/tests/qemuxml2xmloutdata/aarch64-virt-graphics.aarch64-latest.xml
@@ -9,8 +9,12 @@
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='static'>4</vcpu>
- <os>
- <type arch='aarch64' machine='virt'>hvm</type>
+ <os firmware='efi'>
+ <type arch='aarch64' machine='virt-4.0'>hvm</type>
+ <firmware>
+ <feature enabled='no' name='enrolled-keys'/>
+ <feature enabled='no' name='secure-boot'/>
+ </firmware>
<loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
<nvram template='/usr/share/AAVMF/AAVMF_VARS.fd'>/some/user/nvram/path/guest_VARS.fd</nvram>
<boot dev='hd'/>
diff --git a/tests/qemuxml2xmloutdata/aarch64-virt-headless.aarch64-latest.xml b/tests/qemuxml2xmloutdata/aarch64-virt-headless.aarch64-latest.xml
index 6182da4dc6..ab4126318a 100644
--- a/tests/qemuxml2xmloutdata/aarch64-virt-headless.aarch64-latest.xml
+++ b/tests/qemuxml2xmloutdata/aarch64-virt-headless.aarch64-latest.xml
@@ -9,8 +9,12 @@
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='static'>4</vcpu>
- <os>
- <type arch='aarch64' machine='virt'>hvm</type>
+ <os firmware='efi'>
+ <type arch='aarch64' machine='virt-4.0'>hvm</type>
+ <firmware>
+ <feature enabled='no' name='enrolled-keys'/>
+ <feature enabled='no' name='secure-boot'/>
+ </firmware>
<loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
<nvram template='/usr/share/AAVMF/AAVMF_VARS.fd'>/some/user/nvram/path/guest_VARS.fd</nvram>
<boot dev='hd'/>
--
2.42.0

View File

@ -229,7 +229,7 @@
Summary: Library providing a simple virtualization API
Name: libvirt
Version: 9.5.0
Release: 5%{?dist}%{?extra_release}
Release: 6%{?dist}%{?extra_release}
License: GPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OFL-1.1
URL: https://libvirt.org/
@ -252,6 +252,26 @@ Patch11: libvirt-node_device-Don-t-leak-error-message-buffer-from-virMdevctlList
Patch12: libvirt-storage-Fix-returning-of-locked-objects-from-virStoragePoolObjListSearch.patch
Patch13: libvirt-Revert-qemu_passt-Actually-use-logfd.patch
Patch14: libvirt-Revert-qemu_passt-Precreate-passt-logfile.patch
Patch15: libvirt-tests-Use-DO_TEST_CAPS_-_ABI_UPDATE-for-ppc64.patch
Patch16: libvirt-tests-Switch-to-firmware-autoselection-for-hvf.patch
Patch17: libvirt-tests-Use-virt-4.0-machine-type-for-aarch64.patch
Patch18: libvirt-tests-Consistently-use-path-to-guest_VARS.fd.patch
Patch19: libvirt-tests-Turn-abi-update.xml-into-a-symlink.patch
Patch20: libvirt-tests-Rename-firmware-auto-efi-nvram-path.patch
Patch21: libvirt-qemu-Fix-return-value-for-qemuFirmwareFillDomainLegacy.patch
Patch22: libvirt-qemu-Fix-lookup-against-stateless-combined-pflash.patch
Patch23: libvirt-tests-Add-some-more-DO_TEST-ABI_UPDATE-macros.patch
Patch24: libvirt-tests-Add-more-tests-for-firmware-selection.patch
Patch25: libvirt-tests-Update-firmware-descriptor-files.patch
Patch26: libvirt-tests-Drop-tags-from-BIOS-firmware-descriptor.patch
Patch27: libvirt-tests-Include-microvm-in-firmwaretest.patch
Patch28: libvirt-qemu-Don-t-overwrite-NVRAM-template-for-legacy-firmware.patch
Patch29: libvirt-qemu-Generate-NVRAM-path-in-more-cases.patch
Patch30: libvirt-qemu-Filter-firmware-based-on-loader.readonly.patch
Patch31: libvirt-qemu-Match-NVRAM-template-extension-for-new-domains.patch
Patch32: libvirt-conf-Don-t-default-to-raw-format-for-loader-NVRAM.patch
Patch33: libvirt-tests-Rename-firmware-auto-efi-format-loader-qcow2-nvram-path.patch
Patch34: libvirt-tests-Reintroduce-firmware-auto-efi-format-mismatch.patch
Requires: libvirt-daemon = %{version}-%{release}
@ -477,7 +497,8 @@ Requires: polkit >= 0.112
Requires: dmidecode
%endif
# For service management
Requires(post): /usr/bin/systemctl
Requires(posttrans): /usr/bin/systemctl
Requires(preun): /usr/bin/systemctl
# libvirtd depends on 'messagebus' service
Requires: dbus
# For uid creation during pre
@ -1489,259 +1510,289 @@ rm -rf $RPM_BUILD_ROOT%{mingw64_libexecdir}/libvirt-guests.sh
# raising the test timeout
VIR_TEST_DEBUG=1 %meson_test --no-suite syntax-check --timeout-multiplier 10
%define libvirt_daemon_schedule_restart() mkdir -p %{_localstatedir}/lib/rpm-state/libvirt || : \
/bin/systemctl is-active %1.service 1>/dev/null 2>&1 && \
touch %{_localstatedir}/lib/rpm-state/libvirt/restart-%1 || :
%define libvirt_rpmstatedir %{_localstatedir}/lib/rpm-state/libvirt
%define libvirt_daemon_finish_restart() rm -f %{_localstatedir}/lib/rpm-state/libvirt/restart-%1 \
rmdir %{_localstatedir}/lib/rpm-state/libvirt 2>/dev/null || :
# Mark units such that presets will later be applied to them. Meant
# to be called during %pre. Units that already exist on the system
# will not be marked, with the assumption that presets have already
# been applied at some point in the past. This makes it safe to call
# this macro for all units each time %pre runs.
%define libvirt_systemd_schedule_preset() \
mkdir -p %{libvirt_rpmstatedir} || : \
for unit in %{?*}; do \
if ! test -e %{_unitdir}/$unit; then \
touch %{libvirt_rpmstatedir}/preset-$unit || : \
fi \
done \
%{nil}
%define libvirt_daemon_needs_restart() -f %{_localstatedir}/lib/rpm-state/libvirt/restart-%1
# Apply presets for units that have previously been marked. Meant to
# be called during %posttrans. Note that foo.service must be passed
# as the first argument, before all the various foo*.socket
# associated with it, for things to work correctly. This is necessary
# because Also=foo.socket is usually present in foo.service's
# [Install] section, and we want that configuration to take
# precedence over foo.socket's own presets.
%define libvirt_systemd_perform_preset() \
%{?7:%{error:Too many arguments}} \
for unit in %{?2} %{?3} %{?4} %{?5} %{?6} %1; do \
if test -e %{libvirt_rpmstatedir}/preset-$unit; then \
/usr/bin/systemctl --no-reload preset $unit || : \
fi \
rm -f %{libvirt_rpmstatedir}/preset-$unit \
done \
rmdir %{libvirt_rpmstatedir} 2>/dev/null || : \
%{nil}
%define libvirt_daemon_perform_restart() if test %libvirt_daemon_needs_restart %1 \
then \
/bin/systemctl try-restart %1.service >/dev/null 2>&1 || : \
fi \
%libvirt_daemon_finish_restart %1
# Mark a single unit for restart. Meant to be called during %pre.
%define libvirt_systemd_schedule_restart() \
mkdir -p %{libvirt_rpmstatedir} || : \
touch %{libvirt_rpmstatedir}/restart-%1 || : \
%{nil}
# Restart a unit that was previously marked. Meant to be called
# during %posttrans. If systemd is not running, no action will be
# performed.
%define libvirt_systemd_perform_restart() \
if test -d /run/systemd/system && \
test -e %{libvirt_rpmstatedir}/restart-%1; then \
/usr/bin/systemctl try-restart %1 >/dev/null 2>&1 || : \
fi \
rm -f %{libvirt_rpmstatedir}/restart-%1 \
rmdir %{libvirt_rpmstatedir} 2>/dev/null || : \
%{nil}
# Mark a single unit for reload. Meant to be called during %pre.
%define libvirt_systemd_schedule_reload() \
mkdir -p %{libvirt_rpmstatedir} || : \
touch %{libvirt_rpmstatedir}/reload-%1 || : \
%{nil}
# Reload a unit that was previously marked. Meant to be called during
# %posttrans. If systemd is not running, no action will be performed.
%define libvirt_systemd_perform_reload() \
if test -d /run/systemd/system && \
test -e %{libvirt_rpmstatedir}/reload-%1; then \
/usr/bin/systemctl try-reload-or-restart %1 >/dev/null 2>&1 || : \
fi \
rm -f %{libvirt_rpmstatedir}/reload-%1 \
rmdir %{libvirt_rpmstatedir} 2>/dev/null || : \
%{nil}
# Disable a single unit, optionally stopping it if systemd is
# running. Meant to be called during %preun.
%define libvirt_systemd_disable() \
if test -d /run/systemd/system; then \
/usr/bin/systemctl --no-reload disable --now %{?*} || : \
else \
/usr/bin/systemctl --no-reload disable %{?*} || : \
fi \
%{nil}
# %pre implementation for services that should be restarted on
# upgrade. Note that foo.service must be passed as the first
# argument, before all the various foo*.socket associated with it.
%define libvirt_systemd_restart_pre() \
%libvirt_systemd_schedule_preset %{?*} \
%libvirt_systemd_schedule_restart %1 \
%{nil}
# %pre implementation for services that should be reloaded on
# upgrade. Note that foo.service must be passed as the first
# argument, before all the various foo*.socket associated with it.
%define libvirt_systemd_reload_pre() \
%libvirt_systemd_schedule_preset %{?*} \
%libvirt_systemd_schedule_reload %1 \
%{nil}
# %pre implementation for services that should be neither restarted
# nor reloaded on upgrade.
%define libvirt_systemd_noaction_pre() \
%libvirt_systemd_schedule_preset %{?*} \
%{nil}
# %posttrans implementation for all services. We can use a single
# macro to cover all scenarios, because each operation will only be
# performed if it had previously been scheduled. Note that
# foo.service must be passed as the first argument, before all the
# various foo*.socket associated with it.
%define libvirt_systemd_posttrans() \
%libvirt_systemd_perform_preset %{?*} \
%libvirt_systemd_perform_reload %1 \
%libvirt_systemd_perform_restart %1 \
%{nil}
# %preun implementation for all services.
%define libvirt_systemd_preun() \
if [ $1 -lt 1 ]; then \
%libvirt_systemd_disable %{?*} \
fi \
%{nil}
# For daemons with only UNIX sockets
%define libvirt_daemon_systemd_post() %systemd_post %1.socket %1-ro.socket %1-admin.socket %1.service
%define libvirt_daemon_systemd_preun() %systemd_preun %1.service %1-ro.socket %1-admin.socket %1.socket
%define libvirt_systemd_unix_pre() %libvirt_systemd_restart_pre %1.service %1.socket %1-ro.socket %1-admin.socket
%define libvirt_systemd_unix_posttrans() %libvirt_systemd_posttrans %1.service %1.socket %1-ro.socket %1-admin.socket
%define libvirt_systemd_unix_preun() %libvirt_systemd_preun %1.service %1.socket %1-ro.socket %1-admin.socket
# For daemons with UNIX and INET sockets
%define libvirt_daemon_systemd_post_inet() %systemd_post %1.socket %1-ro.socket %1-admin.socket %1-tls.socket %1-tcp.socket %1.service
%define libvirt_daemon_systemd_preun_inet() %systemd_preun %1.service %1-ro.socket %1-admin.socket %1-tls.socket %1-tcp.socket %1.socket
%define libvirt_systemd_inet_pre() %libvirt_systemd_restart_pre %1.service %1.socket %1-ro.socket %1-admin.socket %1-tls.socket %1-tcp.socket
%define libvirt_systemd_inet_posttrans() %libvirt_systemd_posttrans %1.service %1.socket %1-ro.socket %1-admin.socket %1-tls.socket %1-tcp.socket
%define libvirt_systemd_inet_preun() %libvirt_systemd_preun %1.service %1.socket %1-ro.socket %1-admin.socket %1-tls.socket %1-tcp.socket
# For daemons with only UNIX sockets and no unprivileged read-only access
%define libvirt_daemon_systemd_post_priv() %systemd_post %1.socket %1-admin.socket %1.service
%define libvirt_daemon_systemd_preun_priv() %systemd_preun %1.service %1-admin.socket %1.socket
%define libvirt_systemd_privileged_pre() %libvirt_systemd_reload_pre %1.service %1.socket %1-admin.socket
%define libvirt_systemd_privileged_posttrans() %libvirt_systemd_posttrans %1.service %1.socket %1-admin.socket
%define libvirt_systemd_privileged_preun() %libvirt_systemd_preun %1.service %1.socket %1-admin.socket
# For one-shot daemons that have no associated sockets and should never be restarted
%define libvirt_systemd_oneshot_pre() %libvirt_systemd_noaction_pre %1.service
%define libvirt_systemd_oneshot_posttrans() %libvirt_systemd_posttrans %1.service
%define libvirt_systemd_oneshot_preun() %libvirt_systemd_preun %1.service
# For packages that install configuration for other daemons
%define libvirt_systemd_config_pre() %libvirt_systemd_schedule_restart %1.service
%define libvirt_systemd_config_posttrans() %libvirt_systemd_perform_restart %1.service
%pre daemon
%libvirt_sysconfig_pre libvirtd
%post daemon
%if ! %{with_modular_daemons}
%libvirt_daemon_systemd_post_inet libvirtd
%endif
%libvirt_daemon_schedule_restart libvirtd
%preun daemon
%libvirt_daemon_systemd_preun_inet libvirtd
%libvirt_systemd_inet_pre libvirtd
%posttrans daemon
%libvirt_sysconfig_posttrans libvirtd
if test %libvirt_daemon_needs_restart libvirtd
then
# See if user has previously modified their install to
# tell libvirtd to use --listen
grep -E '^LIBVIRTD_ARGS=.*--listen' /etc/sysconfig/libvirtd 1>/dev/null 2>&1
if test $? = 0
then
# Then lets keep honouring --listen and *not* use
# systemd socket activation, because switching things
# might confuse mgmt tool like puppet/ansible that
# expect the old style libvirtd
/bin/systemctl mask \
libvirtd.socket \
libvirtd-ro.socket \
libvirtd-admin.socket \
libvirtd-tls.socket \
libvirtd-tcp.socket >/dev/null 2>&1 || :
/bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
else
# Old libvirtd owns the sockets and will delete them on
# shutdown. Can't use a try-restart as libvirtd will simply
# own the sockets again when it comes back up. Thus we must
# do this particular ordering, so that we get libvirtd
# running with socket activation in use
/bin/systemctl stop libvirtd.service >/dev/null 2>&1 || :
/bin/systemctl try-restart \
libvirtd.socket \
libvirtd-ro.socket \
libvirtd-admin.socket >/dev/null 2>&1 || :
/bin/systemctl start libvirtd.service >/dev/null 2>&1 || :
fi
fi
%libvirt_daemon_finish_restart libvirtd
%libvirt_systemd_inet_posttrans libvirtd
%preun daemon
%libvirt_systemd_inet_preun libvirtd
%pre daemon-common
%libvirt_sysconfig_pre libvirt-guests
%libvirt_systemd_oneshot_pre libvirt-guests
# 'libvirt' group is just to allow password-less polkit access to libvirt
# daemons. The uid number is irrelevant, so we use dynamic allocation.
getent group libvirt >/dev/null || groupadd -r libvirt
exit 0
%post daemon-common
%systemd_post libvirt-guests.service
%preun daemon-common
%systemd_preun libvirt-guests.service
%postun daemon-common
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%systemd_postun libvirt-guests.service
%posttrans daemon-common
%libvirt_sysconfig_posttrans libvirt-guests
%libvirt_systemd_oneshot_posttrans libvirt-guests
%preun daemon-common
%libvirt_systemd_oneshot_preun libvirt-guests
%pre daemon-lock
%libvirt_sysconfig_pre virtlockd
%post daemon-lock
%libvirt_daemon_systemd_post_priv virtlockd
%preun daemon-lock
%libvirt_daemon_systemd_preun_priv virtlockd
%postun daemon-lock
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
/bin/systemctl reload-or-try-restart virtlockd.service >/dev/null 2>&1 || :
fi
%libvirt_systemd_privileged_pre virtlockd
%posttrans daemon-lock
%libvirt_sysconfig_posttrans virtlockd
%libvirt_systemd_privileged_posttrans virtlockd
%preun daemon-lock
%libvirt_systemd_privileged_preun virtlockd
%pre daemon-log
%libvirt_sysconfig_pre virtlogd
%post daemon-log
%libvirt_daemon_systemd_post_priv virtlogd
%preun daemon-log
%libvirt_daemon_systemd_preun_priv virtlogd
%postun daemon-log
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
/bin/systemctl reload-or-try-restart virtlogd.service >/dev/null 2>&1 || :
fi
%libvirt_systemd_privileged_pre virtlogd
%posttrans daemon-log
%libvirt_sysconfig_posttrans virtlogd
%libvirt_systemd_privileged_posttrans virtlogd
%preun daemon-log
%libvirt_systemd_privileged_preun virtlogd
%pre daemon-proxy
%libvirt_sysconfig_pre virtproxyd
%post daemon-proxy
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post_inet virtproxyd
%endif
%preun daemon-proxy
%libvirt_daemon_systemd_preun_inet virtproxyd
%libvirt_systemd_inet_pre virtproxyd
%posttrans daemon-proxy
%libvirt_sysconfig_posttrans virtproxyd
%libvirt_systemd_inet_posttrans virtproxyd
%preun daemon-proxy
%libvirt_systemd_inet_preun virtproxyd
%pre daemon-driver-network
%libvirt_sysconfig_pre virtnetworkd
%libvirt_systemd_unix_pre virtnetworkd
%post daemon-driver-network
%if %{with_firewalld_zone}
%firewalld_reload
%endif
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtnetworkd
%endif
%libvirt_daemon_schedule_restart virtnetworkd
%posttrans daemon-driver-network
%libvirt_sysconfig_posttrans virtnetworkd
%libvirt_systemd_unix_posttrans virtnetworkd
%preun daemon-driver-network
%libvirt_daemon_systemd_preun virtnetworkd
%libvirt_systemd_unix_preun virtnetworkd
%postun daemon-driver-network
%if %{with_firewalld_zone}
%firewalld_reload
%endif
%posttrans daemon-driver-network
%libvirt_sysconfig_posttrans virtnetworkd
%libvirt_daemon_perform_restart virtnetworkd
%pre daemon-driver-nwfilter
%libvirt_sysconfig_pre virtnwfilterd
%post daemon-driver-nwfilter
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtnwfilterd
%endif
%libvirt_daemon_schedule_restart virtnwfilterd
%preun daemon-driver-nwfilter
%libvirt_daemon_systemd_preun virtnwfilterd
%libvirt_systemd_unix_pre virtnwfilterd
%posttrans daemon-driver-nwfilter
%libvirt_sysconfig_posttrans virtnwfilterd
%libvirt_daemon_perform_restart virtnwfilterd
%libvirt_systemd_unix_posttrans virtnwfilterd
%preun daemon-driver-nwfilter
%libvirt_systemd_unix_preun virtnwfilterd
%pre daemon-driver-nodedev
%libvirt_sysconfig_pre virtnodedevd
%post daemon-driver-nodedev
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtnodedevd
%endif
%libvirt_daemon_schedule_restart virtnodedevd
%preun daemon-driver-nodedev
%libvirt_daemon_systemd_preun virtnodedevd
%libvirt_systemd_unix_pre virtnodedevd
%posttrans daemon-driver-nodedev
%libvirt_sysconfig_posttrans virtnodedevd
%libvirt_daemon_perform_restart virtnodedevd
%libvirt_systemd_unix_posttrans virtnodedevd
%preun daemon-driver-nodedev
%libvirt_systemd_unix_preun virtnodedevd
%pre daemon-driver-interface
%libvirt_sysconfig_pre virtinterfaced
%post daemon-driver-interface
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtinterfaced
%endif
%libvirt_daemon_schedule_restart virtinterfaced
%preun daemon-driver-interface
%libvirt_daemon_systemd_preun virtinterfaced
%libvirt_systemd_unix_pre virtinterfaced
%posttrans daemon-driver-interface
%libvirt_sysconfig_posttrans virtinterfaced
%libvirt_daemon_perform_restart virtinterfaced
%libvirt_systemd_unix_posttrans virtinterfaced
%preun daemon-driver-interface
%libvirt_systemd_unix_preun virtinterfaced
%pre daemon-driver-secret
%libvirt_sysconfig_pre virtsecretd
%post daemon-driver-secret
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtsecretd
%endif
%libvirt_daemon_schedule_restart virtsecretd
%preun daemon-driver-secret
%libvirt_daemon_systemd_preun virtsecretd
%libvirt_systemd_unix_pre virsecretd
%posttrans daemon-driver-secret
%libvirt_sysconfig_posttrans virtsecretd
%libvirt_daemon_perform_restart virtsecretd
%libvirt_systemd_unix_posttrans virsecretd
%preun daemon-driver-secret
%libvirt_systemd_unix_preun virsecretd
%pre daemon-driver-storage-core
%libvirt_sysconfig_pre virtstoraged
%post daemon-driver-storage-core
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtstoraged
%endif
%libvirt_daemon_schedule_restart virtstoraged
%preun daemon-driver-storage-core
%libvirt_daemon_systemd_preun virtstoraged
%libvirt_systemd_unix_pre virtstoraged
%posttrans daemon-driver-storage-core
%libvirt_sysconfig_posttrans virtstoraged
%libvirt_daemon_perform_restart virtstoraged
%libvirt_systemd_unix_posttrans virtstoraged
%preun daemon-driver-storage-core
%libvirt_systemd_unix_preun virtstoraged
%if %{with_qemu}
%pre daemon-driver-qemu
%libvirt_sysconfig_pre virtqemud
%libvirt_systemd_unix_pre virtqemud
# We want soft static allocation of well-known ids, as disk images
# are commonly shared across NFS mounts by id rather than name; see
# https://fedoraproject.org/wiki/Packaging:UsersAndGroups
@ -1756,74 +1807,57 @@ if ! getent passwd qemu >/dev/null; then
fi
exit 0
%post daemon-driver-qemu
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtqemud
%endif
%libvirt_daemon_schedule_restart virtqemud
%preun daemon-driver-qemu
%libvirt_daemon_systemd_preun virtqemud
%posttrans daemon-driver-qemu
%libvirt_sysconfig_posttrans virtqemud
%libvirt_daemon_perform_restart virtqemud
%libvirt_systemd_unix_posttrans virtqemud
%preun daemon-driver-qemu
%libvirt_systemd_unix_preun virtqemud
%endif
%if %{with_lxc}
%pre daemon-driver-lxc
%libvirt_sysconfig_pre virtlxcd
%post daemon-driver-lxc
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtlxcd
%endif
%libvirt_daemon_schedule_restart virtlxcd
%preun daemon-driver-lxc
%libvirt_daemon_systemd_preun virtlxcd
%libvirt_systemd_unix_pre virtlxcd
%posttrans daemon-driver-lxc
%libvirt_sysconfig_posttrans virtlxcd
%libvirt_daemon_perform_restart virtlxcd
%libvirt_systemd_unix_posttrans virtlxcd
%preun daemon-driver-lxc
%libvirt_systemd_unix_preun virtlxcd
%endif
%if %{with_vbox}
%post daemon-driver-vbox
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtvboxd
%endif
%libvirt_daemon_schedule_restart virtvboxd
%pre daemon-driver-vbox
%libvirt_sysconfig_pre virtvboxd
%preun daemon-driver-vbox
%libvirt_daemon_systemd_preun virtvboxd
%libvirt_systemd_unix_pre virtvboxd
%posttrans daemon-driver-vbox
%libvirt_sysconfig_posttrans virtvboxd
%libvirt_daemon_perform_restart virtvboxd
%libvirt_systemd_unix_posttrans virtvboxd
%preun daemon-driver-vbox
%libvirt_systemd_unix_preun virtvboxd
%endif
%if %{with_libxl}
%post daemon-driver-libxl
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtxend
%endif
%libvirt_daemon_schedule_restart virtxend
%pre daemon-driver-libxl
%libvirt_sysconfig_pre virtxend
%preun daemon-driver-libxl
%libvirt_daemon_systemd_preun virtxend
%libvirt_systemd_unix_pre virtxend
%posttrans daemon-driver-libxl
%libvirt_sysconfig_posttrans virtxend
%libvirt_daemon_perform_restart virtxend
%libvirt_systemd_unix_posttrans virtxend
%preun daemon-driver-libxl
%libvirt_systemd_unix_preun virtxend
%endif
%pre daemon-config-network
%libvirt_systemd_config_pre libvirtd
%libvirt_systemd_config_pre virtnetworkd
%post daemon-config-network
if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; then
# see if the network used by default network creates a conflict,
@ -1860,15 +1894,15 @@ if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ;
ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
# libvirt saves this file with mode 0600
chmod 0600 %{_sysconfdir}/libvirt/qemu/networks/default.xml
# Make sure libvirt picks up the new network defininiton
%libvirt_daemon_schedule_restart libvirtd
%libvirt_daemon_schedule_restart virtnetworkd
fi
%posttrans daemon-config-network
%libvirt_daemon_perform_restart libvirtd
%libvirt_daemon_perform_restart virtnetworkd
%libvirt_systemd_config_posttrans libvirtd
%libvirt_systemd_config_posttrans virtnetworkd
%pre daemon-config-nwfilter
%libvirt_systemd_config_pre libvirtd
%libvirt_systemd_config_pre virtnwfilterd
%post daemon-config-nwfilter
for datadir_file in %{_datadir}/libvirt/nwfilter/*.xml; do
@ -1878,13 +1912,10 @@ for datadir_file in %{_datadir}/libvirt/nwfilter/*.xml; do
install -m 0600 "$datadir_file" "$sysconfdir_file"
fi
done
# Make sure libvirt picks up the new nwfilter defininitons
%libvirt_daemon_schedule_restart libvirtd
%libvirt_daemon_schedule_restart virtnwfilterd
%posttrans daemon-config-nwfilter
%libvirt_daemon_perform_restart libvirtd
%libvirt_daemon_perform_restart virtnwfilterd
%libvirt_systemd_config_posttrans libvirtd
%libvirt_systemd_config_posttrans virtnwfilterd
%if %{with_lxc}
%pre login-shell
@ -2488,6 +2519,34 @@ exit 0
%endif
%changelog
* Fri Aug 25 2023 Jiri Denemark <jdenemar@redhat.com> - 9.5.0-6
- tests: Use DO_TEST_CAPS_*_ABI_UPDATE() for ppc64 (rhbz#2196178)
- tests: Switch to firmware autoselection for hvf (rhbz#2196178)
- tests: Use virt-4.0 machine type for aarch64 (rhbz#2196178)
- tests: Consistently use /path/to/guest_VARS.fd (rhbz#2196178)
- tests: Turn abi-update.xml into a symlink (rhbz#2196178)
- tests: Rename firmware-auto-efi-nvram-path (rhbz#2196178)
- qemu: Fix return value for qemuFirmwareFillDomainLegacy() (rhbz#2196178)
- qemu: Fix lookup against stateless/combined pflash (rhbz#2196178)
- tests: Add some more DO_TEST*ABI_UPDATE* macros (rhbz#2196178)
- tests: Add more tests for firmware selection (rhbz#2196178)
- tests: Update firmware descriptor files (rhbz#2196178)
- tests: Drop tags from BIOS firmware descriptor (rhbz#2196178)
- tests: Include microvm in firmwaretest (rhbz#2196178)
- qemu: Don't overwrite NVRAM template for legacy firmware (rhbz#2196178)
- qemu: Generate NVRAM path in more cases (rhbz#2196178)
- qemu: Filter firmware based on loader.readonly (rhbz#2196178)
- qemu: Match NVRAM template extension for new domains (rhbz#2196178)
- conf: Don't default to raw format for loader/NVRAM (rhbz#2196178)
- tests: Rename firmware-auto-efi-format-loader-qcow2-nvram-path (rhbz#2196178)
- tests: Reintroduce firmware-auto-efi-format-mismatch (rhbz#2196178)
- rpm: Reorder scriptlets (rhbz#2210058)
- rpm: Reduce use of with_modular_daemons (rhbz#2210058)
- rpm: Remove custom libvirtd restart logic (rhbz#2210058)
- rpm: Introduce new macros for handling of systemd units (rhbz#2210058)
- rpm: Switch to new macros for handling of systemd units (rhbz#2210058)
- rpm: Delete unused macros (rhbz#2210058)
* Wed Aug 2 2023 Jiri Denemark <jdenemar@redhat.com> - 9.5.0-5
- Revert "qemu_passt: Actually use @logfd" (rhbz#2209191)
- Revert "qemu_passt: Precreate passt logfile" (rhbz#2209191)