Enable ppc64le

This commit is contained in:
eabdullin 2023-12-07 16:52:11 +03:00
parent 3d6a2873f7
commit 9fa8e46f5a
47 changed files with 51998 additions and 603 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/libvirt-8.5.0.tar.xz
SOURCES/libvirt-9.5.0.tar.xz

View File

@ -1 +1 @@
d5fc6173368e7c32cd87d6c8e3c9cfd9d5622860 SOURCES/libvirt-8.5.0.tar.xz
472f6871651d8d3b41b2a2602adfcdb18629049d SOURCES/libvirt-9.5.0.tar.xz

View File

@ -0,0 +1,38 @@
From f3e5bf77bc6f591e5799ae9de36498df5c2a1811 Mon Sep 17 00:00:00 2001
Message-ID: <f3e5bf77bc6f591e5799ae9de36498df5c2a1811.1691014499.git.jdenemar@redhat.com>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Tue, 1 Aug 2023 16:18:47 +0200
Subject: [PATCH] Revert "qemu_passt: Actually use @logfd"
This reverts commit 83686f1eea1a001a37a92f2c054ffb2689c43a40.
This is needed only so that the next revert is clean.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
(cherry picked from commit bc9a254dc72b6904e8368c3fea3ab49b7238ff34)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2209191
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_passt.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c
index 3679bf75fc..25b22d8ad9 100644
--- a/src/qemu/qemu_passt.c
+++ b/src/qemu/qemu_passt.c
@@ -204,9 +204,9 @@ qemuPasstStart(virDomainObj *vm,
/* The logFile location is not restricted to a per-domain directory. It
* can be anywhere. Pre-create it as passt may not have enough perms to
* do so. */
- if ((logfd = qemuDomainOpenFile(cfg, vm->def, net->backend.logFile,
- O_CREAT | O_TRUNC | O_APPEND | O_RDWR,
- &needUnlink)) < 0) {
+ if (qemuDomainOpenFile(cfg, vm->def, net->backend.logFile,
+ O_CREAT | O_TRUNC | O_APPEND | O_RDWR,
+ &needUnlink) < 0) {
return -1;
}
--
2.41.0

View File

@ -0,0 +1,148 @@
From 8897c7d63f763bf9b59f7e79ec6b2f9caf84823b Mon Sep 17 00:00:00 2001
Message-ID: <8897c7d63f763bf9b59f7e79ec6b2f9caf84823b.1691014499.git.jdenemar@redhat.com>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Tue, 1 Aug 2023 16:20:58 +0200
Subject: [PATCH] Revert "qemu_passt: Precreate passt logfile"
This reverts commit 8511b96a319836700b4829816cdae27c3630060d.
Turns out, we need to do a bit more than just plain
qemuSecurityDomainSetPathLabel() which sets svirt_image_t. Passt
has its own SELinux policy and as a part of that they invent
passt_log_t for log files. Right now, I don't know how libvirt
could query that and even if I did, passt SELinux policy would
need to permit relabelling from svirt_t to passt_log_t, which it
doesn't [1].
Until these problems are addressed we shouldn't be pre-creating
the file as it puts users into way worse position - even
scenarios that used to work don't work. But then again - using
log file for passt is usually valuable for developers only and
not regular users.
1: https://bugzilla.redhat.com/show_bug.cgi?id=2209191#c10
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
(cherry picked from commit 99349ba18e726465215a71f28d2146a0a2adb65d)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2209191
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_passt.c | 40 +++++-----------------------------------
1 file changed, 5 insertions(+), 35 deletions(-)
diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c
index 25b22d8ad9..99636a3a49 100644
--- a/src/qemu/qemu_passt.c
+++ b/src/qemu/qemu_passt.c
@@ -20,8 +20,6 @@
#include <config.h>
-#include <fcntl.h>
-
#include "qemu_dbus.h"
#include "qemu_extdevice.h"
#include "qemu_security.h"
@@ -138,13 +136,9 @@ void
qemuPasstStop(virDomainObj *vm,
virDomainNetDef *net)
{
- qemuDomainObjPrivate *priv = vm->privateData;
- virQEMUDriver *driver = priv->driver;
g_autofree char *pidfile = qemuPasstCreatePidFilename(vm, net);
g_autofree char *passtSocketName = qemuPasstCreateSocketPath(vm, net);
- qemuSecurityDomainRestorePathLabel(driver, vm, net->backend.logFile);
-
qemuPasstKill(pidfile, passtSocketName);
}
@@ -172,12 +166,10 @@ qemuPasstStart(virDomainObj *vm,
{
qemuDomainObjPrivate *priv = vm->privateData;
virQEMUDriver *driver = priv->driver;
- g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
g_autofree char *passtSocketName = qemuPasstCreateSocketPath(vm, net);
g_autoptr(virCommand) cmd = NULL;
g_autofree char *pidfile = qemuPasstCreatePidFilename(vm, net);
char macaddr[VIR_MAC_STRING_BUFLEN];
- bool needUnlink = false;
size_t i;
cmd = virCommandNew(PASST);
@@ -199,25 +191,8 @@ qemuPasstStart(virDomainObj *vm,
if (net->sourceDev)
virCommandAddArgList(cmd, "--interface", net->sourceDev, NULL);
- if (net->backend.logFile) {
- VIR_AUTOCLOSE logfd = -1;
- /* The logFile location is not restricted to a per-domain directory. It
- * can be anywhere. Pre-create it as passt may not have enough perms to
- * do so. */
- if (qemuDomainOpenFile(cfg, vm->def, net->backend.logFile,
- O_CREAT | O_TRUNC | O_APPEND | O_RDWR,
- &needUnlink) < 0) {
- return -1;
- }
-
- if (qemuSecurityDomainSetPathLabel(driver, vm,
- net->backend.logFile, false) < 0) {
- goto error;
- }
-
- /* Worse, passt deliberately doesn't support FD passing. */
+ if (net->backend.logFile)
virCommandAddArgList(cmd, "--log-file", net->backend.logFile, NULL);
- }
/* Add IP address info */
for (i = 0; i < net->guestIP.nips; i++) {
@@ -228,7 +203,7 @@ qemuPasstStart(virDomainObj *vm,
* a single IPv4 and single IPv6 address
*/
if (!(addr = virSocketAddrFormat(&ip->address)))
- goto error;
+ return -1;
virCommandAddArgList(cmd, "--address", addr, NULL);
@@ -256,14 +231,14 @@ qemuPasstStart(virDomainObj *vm,
/* validation guarantees this will never happen */
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid portForward proto value %1$u"), pf->proto);
- goto error;
+ return -1;
}
if (VIR_SOCKET_ADDR_VALID(&pf->address)) {
g_autofree char *addr = NULL;
if (!(addr = virSocketAddrFormat(&pf->address)))
- goto error;
+ return -1;
virBufferAddStr(&buf, addr);
emitsep = true;
@@ -309,7 +284,7 @@ qemuPasstStart(virDomainObj *vm,
if (qemuExtDeviceLogCommand(driver, vm, cmd, "passt") < 0)
- goto error;
+ return -1;
if (qemuSecurityCommandRun(driver, vm, cmd, -1, -1, true, NULL) < 0)
goto error;
@@ -317,11 +292,6 @@ qemuPasstStart(virDomainObj *vm,
return 0;
error:
- if (needUnlink && unlink(net->backend.logFile) < 0) {
- VIR_WARN("Unable to unlink '%s': %s",
- net->backend.logFile, g_strerror(errno));
- }
-
qemuPasstKill(pidfile, passtSocketName);
return -1;
}
--
2.41.0

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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,53 @@
From bbfcf18f504b0eb165c0bbfe2f34b4e20d11c355 Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Fri, 25 Aug 2023 00:09:54 -0400
Subject: [PATCH] docs: update description of virsh nodedev-detach --driver
option
--driver can now be used to specify a specific driver to bind to the
device being detached from the host driver (e.g. vfio-pci-igbvf), not
just the *type* of driver (e.g. "vfio" or "xen", which are unnecessary
anyway, since they are implicit in which hypervisor driver is in use)
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
docs/manpages/virsh.rst | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index 673812036d3..91e1d5de37d 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -5388,14 +5388,23 @@ nodedev-detach
nodedev-detach nodedev [--driver backend_driver]
-Detach *nodedev* from the host, so that it can safely be used by
-guests via <hostdev> passthrough. This is reversed with
-``nodedev-reattach``, and is done automatically for managed devices.
-
-Different backend drivers expect the device to be bound to different
-dummy devices. For example, QEMU's "vfio" backend driver expects the
-device to be bound to vfio-pci. The *--driver* parameter can be used
-to specify the desired backend driver.
+Detach *nodedev* from the host driver and bind it to a special driver
+that provides the API needed by the hypervisor for assigning the
+device to a virtual machine (using <hostdev> in the domain XML
+definition). This is reversed with ``nodedev-reattach``, and is done
+automatically by the hypervisor driver for managed devices (those
+devices with "managed='yes'" in their XML definition).
+
+Different hypervisors expect the device being assigned to be bound to
+different drivers. For example, QEMU's "vfio" backend requires the
+device to be bound to the driver "vfio-pci" or to a "VFIO variant"
+driver (this is a driver that supports the full API provided by
+vfio-pci, plus some other APIs to support things like live
+migration). The *--driver* parameter can be used to specify a
+particular driver (e.g. a device-specific VFIO variant driver) the
+device should be bound to. When *--driver* is omitted, the default
+driver for the hypervisor is used ("vfio-pci" for QEMU, "pciback" for
+Xen).
nodedev-dumpxml

View File

@ -0,0 +1,79 @@
From f158b6573ac39bdd1ba36c3900e65afffe57f3ca Mon Sep 17 00:00:00 2001
Message-ID: <f158b6573ac39bdd1ba36c3900e65afffe57f3ca.1689974710.git.jdenemar@redhat.com>
From: Peter Krempa <pkrempa@redhat.com>
Date: Wed, 19 Jul 2023 15:22:22 +0200
Subject: [PATCH] node_device: Don't leak error message buffer from
virMdevctlListDefined|Active
nodeDeviceUpdateMediatedDevices invokes virMdevctlListDefined and
virMdevctlListActive both of which were passed the same 'errmsg' buffer.
Since virCommandSetErrorBuffer() always allocates the error buffer one
of them was leaked.
Fix it by populating the 'errmsg' buffer only on failure of
virMdevctlListActive|Defined which invoke the command.
Add a comment to nodeDeviceGetMdevctlListCommand reminding how
virCommandSetErrorBuffer() works.
Fixes: 44a0f2f0c8f
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2143158
(cherry picked from commit 7ca777cc09242cb3a30b12d5e0e396c6aaf1a5e7)
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
src/node_device/node_device_driver.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index 5dc45ddbb4..2ef9197adc 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -1044,6 +1044,15 @@ virMdevctlSetAutostart(virNodeDeviceDef *def, bool autostart, char **errmsg)
}
+/**
+ * nodeDeviceGetMdevctlListCommand:
+ * @defined: list mdevctl entries with persistent config
+ * @output: filled with the output of mdevctl once invoked
+ * @errmsg: always allocated, optionally filled with error from 'mdevctl'
+ *
+ * Prepares a virCommand structure to invoke 'mdevctl' caller is responsible to
+ * free the buffers which are filled by the virCommand infrastructure.
+ */
virCommand*
nodeDeviceGetMdevctlListCommand(bool defined,
char **output,
@@ -1624,9 +1633,11 @@ virMdevctlListDefined(virNodeDeviceDef ***devs, char **errmsg)
{
int status;
g_autofree char *output = NULL;
- g_autoptr(virCommand) cmd = nodeDeviceGetMdevctlListCommand(true, &output, errmsg);
+ g_autofree char *errbuf = NULL;
+ g_autoptr(virCommand) cmd = nodeDeviceGetMdevctlListCommand(true, &output, &errbuf);
if (virCommandRun(cmd, &status) < 0 || status != 0) {
+ *errmsg = g_steal_pointer(&errbuf);
return -1;
}
@@ -1642,9 +1653,11 @@ virMdevctlListActive(virNodeDeviceDef ***devs, char **errmsg)
{
int status;
g_autofree char *output = NULL;
- g_autoptr(virCommand) cmd = nodeDeviceGetMdevctlListCommand(false, &output, errmsg);
+ g_autofree char *errbuf = NULL;
+ g_autoptr(virCommand) cmd = nodeDeviceGetMdevctlListCommand(false, &output, &errbuf);
if (virCommandRun(cmd, &status) < 0 || status != 0) {
+ *errmsg = g_steal_pointer(&errbuf);
return -1;
}
--
2.41.0

View File

@ -0,0 +1,178 @@
From 24beaffec33efa3fa077d7b8596d97aa9a038a01 Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Sun, 9 Jul 2023 00:37:45 -0400
Subject: [PATCH] node_device: support binding other drivers with
virNodeDeviceDetachFlags()
In the past, the only allowable values for the "driver" field of
virNodeDeviceDetachFlags() were "kvm" or "vfio" for the QEMU driver,
and "xen" for the libxl driver. Then "kvm" was deprecated and removed,
so the driver name became essentially irrelevant (because it is always
called via a particular hypervisor driver, and so the "xen" or "vfio"
can be (and almost always is) implied.
With the advent of VFIO variant drivers, the ability to explicitly
specify a driver name once again becomes useful - it can be used to
name the exact VFIO driver that we want bound to the device in place
of vfio-pci, so this patch allows those other names to be passed down
the call chain, where the code in virpci.c can make use of them.
The names "vfio", "kvm", and "xen" retain their special meaning, though:
1) because there may be some application or configuration that still
calls virNodeDeviceDetachFlags() with driverName="vfio", this
single value is substituted with the synonym of NULL, which means
"bind the default driver for this device and hypervisor". This
will currently result in the vfio-pci driver being bound to the
device.
2) in the case of the libxl driver, "xen" means to use the standard
driver used in the case of Xen ("pciback").
3) "kvm" as a driver name always results in an error, as legacy KVM
device assignment was removed from the kernel around 10 years ago.
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/hypervisor/domain_driver.c | 11 ++++++-----
src/hypervisor/domain_driver.h | 2 ++
src/libxl/libxl_driver.c | 3 ++-
src/qemu/qemu_driver.c | 33 +++++++++++++++++++--------------
4 files changed, 29 insertions(+), 20 deletions(-)
diff --git a/src/hypervisor/domain_driver.c b/src/hypervisor/domain_driver.c
index a70f75f3ae8..d9469ad6f96 100644
--- a/src/hypervisor/domain_driver.c
+++ b/src/hypervisor/domain_driver.c
@@ -462,6 +462,7 @@ virDomainDriverNodeDeviceReAttach(virNodeDevicePtr dev,
int
virDomainDriverNodeDeviceDetachFlags(virNodeDevicePtr dev,
virHostdevManager *hostdevMgr,
+ virPCIStubDriver driverType,
const char *driverName)
{
g_autoptr(virPCIDevice) pci = NULL;
@@ -471,8 +472,10 @@ virDomainDriverNodeDeviceDetachFlags(virNodeDevicePtr dev,
g_autoptr(virConnect) nodeconn = NULL;
g_autoptr(virNodeDevice) nodedev = NULL;
- if (!driverName)
+ if (driverType == VIR_PCI_STUB_DRIVER_NONE) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("driver type not set"));
return -1;
+ }
if (!(nodeconn = virGetConnectNodeDev()))
return -1;
@@ -504,10 +507,8 @@ virDomainDriverNodeDeviceDetachFlags(virNodeDevicePtr dev,
if (!pci)
return -1;
- if (STREQ(driverName, "vfio"))
- virPCIDeviceSetStubDriverType(pci, VIR_PCI_STUB_DRIVER_VFIO);
- else if (STREQ(driverName, "xen"))
- virPCIDeviceSetStubDriverType(pci, VIR_PCI_STUB_DRIVER_XEN);
+ virPCIDeviceSetStubDriverType(pci, driverType);
+ virPCIDeviceSetStubDriverName(pci, driverName);
return virHostdevPCINodeDeviceDetach(hostdevMgr, pci);
}
diff --git a/src/hypervisor/domain_driver.h b/src/hypervisor/domain_driver.h
index 4241c869320..9942f58fda1 100644
--- a/src/hypervisor/domain_driver.h
+++ b/src/hypervisor/domain_driver.h
@@ -22,6 +22,7 @@
#include "node_device_conf.h"
#include "virhostdev.h"
+#include "virpci.h"
char *
virDomainDriverGenerateRootHash(const char *drivername,
@@ -58,6 +59,7 @@ int virDomainDriverNodeDeviceReAttach(virNodeDevicePtr dev,
int virDomainDriverNodeDeviceDetachFlags(virNodeDevicePtr dev,
virHostdevManager *hostdevMgr,
+ virPCIStubDriver driverType,
const char *driverName);
int virDomainDriverAddIOThreadCheck(virDomainDef *def,
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 3d10f458508..079922dd32a 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -5876,7 +5876,8 @@ libxlNodeDeviceDetachFlags(virNodeDevicePtr dev,
/* virNodeDeviceDetachFlagsEnsureACL() is being called by
* virDomainDriverNodeDeviceDetachFlags() */
- return virDomainDriverNodeDeviceDetachFlags(dev, hostdev_mgr, driverName);
+ return virDomainDriverNodeDeviceDetachFlags(dev, hostdev_mgr,
+ VIR_PCI_STUB_DRIVER_XEN, NULL);
}
static int
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 73fa499e40d..5128b643642 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -70,7 +70,6 @@
#include "domain_driver.h"
#include "domain_postparse.h"
#include "domain_validate.h"
-#include "virpci.h"
#include "virpidfile.h"
#include "virprocess.h"
#include "libvirt_internal.h"
@@ -11407,24 +11406,28 @@ qemuNodeDeviceDetachFlags(virNodeDevicePtr dev,
virCheckFlags(0, -1);
- if (!driverName)
- driverName = "vfio";
-
- /* Only the 'vfio' driver is supported and a special error message for
- * the previously supported 'kvm' driver is provided below. */
- if (STRNEQ(driverName, "vfio") && STRNEQ(driverName, "kvm")) {
- virReportError(VIR_ERR_INVALID_ARG,
- _("unknown driver name '%1$s'"), driverName);
- return -1;
- }
+ /* For historical reasons, if driverName is "vfio", that is the
+ * same as NULL, i.e. the default vfio driver for this device
+ */
+ if (STREQ_NULLABLE(driverName, "vfio"))
+ driverName = NULL;
- if (STREQ(driverName, "kvm")) {
+ /* the "kvm" driver name was used a very long time ago to force
+ * "legacy KVM device assignment", which hasn't been supported in
+ * over 10 years.
+ */
+ if (STREQ_NULLABLE(driverName, "kvm")) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
- _("KVM device assignment is no longer "
+ _("'legacy KVM' device assignment is no longer "
"supported on this system"));
return -1;
}
+ /* for any other driver, we can't know whether or not it is a VFIO
+ * driver until the device has been bound to it, so we will defer
+ * further validation until then.
+ */
+
if (!qemuHostdevHostSupportsPassthroughVFIO()) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
_("VFIO device assignment is currently not "
@@ -11434,7 +11437,9 @@ qemuNodeDeviceDetachFlags(virNodeDevicePtr dev,
/* virNodeDeviceDetachFlagsEnsureACL() is being called by
* virDomainDriverNodeDeviceDetachFlags() */
- return virDomainDriverNodeDeviceDetachFlags(dev, hostdev_mgr, driverName);
+ return virDomainDriverNodeDeviceDetachFlags(dev, hostdev_mgr,
+ VIR_PCI_STUB_DRIVER_VFIO,
+ driverName);
}
static int

View File

@ -0,0 +1,105 @@
From 05230da856d2f016c21f49a406780fbe15f74c32 Mon Sep 17 00:00:00 2001
Message-ID: <05230da856d2f016c21f49a406780fbe15f74c32.1689602377.git.jdenemar@redhat.com>
From: Jonathon Jongsma <jjongsma@redhat.com>
Date: Wed, 5 Jul 2023 15:35:59 -0500
Subject: [PATCH] nodedev: refactor mdevctl thread functions
Factor out a new scheduleMdevctlUpdate() function so that we can re-use
it from other places. Now that other events can make it necessary to
re-query mdevctl for mdev updates, this function will be useful for
coalescing multiple updates in quick succession into a single mdevctl
query.
Also rename a couple functions. The names weren't very descriptive of
their behavior. For example, the old scheduleMdevctlHandler() function
didn't actually schedule anything, it just started a thread. So rename
it to free up the 'schedule' name for the above refactored function.
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
(cherry picked from commit 9b7fadc5dc33b85b597c95d944dc23c02c29c29f)
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2143158
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
src/node_device/node_device_udev.c | 36 ++++++++++++++++++++----------
1 file changed, 24 insertions(+), 12 deletions(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index fce4212728..86ef4af728 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -2075,7 +2075,7 @@ udevPCITranslateInit(bool privileged G_GNUC_UNUSED)
static void
-mdevctlHandlerThread(void *opaque G_GNUC_UNUSED)
+mdevctlUpdateThreadFunc(void *opaque G_GNUC_UNUSED)
{
udevEventData *priv = driver->privateData;
VIR_LOCK_GUARD lock = virLockGuardLock(&priv->mdevctlLock);
@@ -2086,7 +2086,7 @@ mdevctlHandlerThread(void *opaque G_GNUC_UNUSED)
static void
-scheduleMdevctlHandler(int timer G_GNUC_UNUSED, void *opaque)
+launchMdevctlUpdateThread(int timer G_GNUC_UNUSED, void *opaque)
{
udevEventData *priv = opaque;
virThread thread;
@@ -2096,7 +2096,7 @@ scheduleMdevctlHandler(int timer G_GNUC_UNUSED, void *opaque)
priv->mdevctlTimeout = -1;
}
- if (virThreadCreateFull(&thread, false, mdevctlHandlerThread,
+ if (virThreadCreateFull(&thread, false, mdevctlUpdateThreadFunc,
"mdevctl-thread", false, NULL) < 0) {
virReportSystemError(errno, "%s",
_("failed to create mdevctl thread"));
@@ -2192,6 +2192,26 @@ mdevctlEnableMonitor(udevEventData *priv)
}
+/* Schedules an mdevctl update for 100ms in the future, canceling any existing
+ * timeout that may have been set. In this way, multiple update requests in
+ * quick succession can be collapsed into a single update. if @force is true,
+ * an update thread will be spawned immediately. */
+static void
+scheduleMdevctlUpdate(udevEventData *data,
+ bool force)
+{
+ if (!force) {
+ if (data->mdevctlTimeout > 0)
+ virEventRemoveTimeout(data->mdevctlTimeout);
+ data->mdevctlTimeout = virEventAddTimeout(100, launchMdevctlUpdateThread,
+ data, NULL);
+ return;
+ }
+
+ launchMdevctlUpdateThread(-1, data);
+}
+
+
static void
mdevctlEventHandleCallback(GFileMonitor *monitor G_GNUC_UNUSED,
GFile *file,
@@ -2222,15 +2242,7 @@ mdevctlEventHandleCallback(GFileMonitor *monitor G_GNUC_UNUSED,
* configuration change, try to coalesce these changes by waiting for the
* CHANGES_DONE_HINT event. As a fallback, add a timeout to trigger the
* signal if that event never comes */
- if (event_type != G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT) {
- if (priv->mdevctlTimeout > 0)
- virEventRemoveTimeout(priv->mdevctlTimeout);
- priv->mdevctlTimeout = virEventAddTimeout(100, scheduleMdevctlHandler,
- priv, NULL);
- return;
- }
-
- scheduleMdevctlHandler(-1, priv);
+ scheduleMdevctlUpdate(priv, (event_type == G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT));
}
--
2.41.0

View File

@ -0,0 +1,104 @@
From c2150285aff9b308b969d5fc6f32f75db620dfe3 Mon Sep 17 00:00:00 2001
Message-ID: <c2150285aff9b308b969d5fc6f32f75db620dfe3.1689974710.git.jdenemar@redhat.com>
From: Jonathon Jongsma <jjongsma@redhat.com>
Date: Tue, 18 Jul 2023 14:47:49 -0500
Subject: [PATCH] nodedev: report mdev persistence properly
Since commit 44a0f2f0, we now query mdevctl for transient (active) mdevs
in order to gather attributes for the mdev. Unfortunately, this commit
introduced a regression because nodeDeviceUpdateMediatedDevice() assumed
that all mdevs returned from mdevctl were actually persistent mdevs but
we were using it to update transient mdevs. Refactor the function so
that we can use it to update both persistent and transient mdevs.
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2143158
(cherry picked from commit fa0d5f4ebc0aa178d9dea278914f9149a4c4af54)
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
src/node_device/node_device_driver.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index a2d0600560..5dc45ddbb4 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -1339,11 +1339,12 @@ nodeDeviceDestroy(virNodeDevicePtr device)
/* takes ownership of @def and potentially frees it. @def should not be used
* after returning from this function */
static int
-nodeDeviceUpdateMediatedDevice(virNodeDeviceDef *def)
+nodeDeviceUpdateMediatedDevice(virNodeDeviceDef *def,
+ bool defined)
{
virNodeDeviceObj *obj;
virObjectEvent *event;
- bool defined = false;
+ bool was_defined = false;
g_autoptr(virNodeDeviceDef) owned = def;
g_autofree char *name = g_strdup(owned->name);
@@ -1359,13 +1360,13 @@ nodeDeviceUpdateMediatedDevice(virNodeDeviceDef *def)
bool changed;
virNodeDeviceDef *olddef = virNodeDeviceObjGetDef(obj);
- defined = virNodeDeviceObjIsPersistent(obj);
+ was_defined = virNodeDeviceObjIsPersistent(obj);
/* Active devices contain some additional information (e.g. sysfs
* path) that is not provided by mdevctl, so re-use the existing
* definition and copy over new mdev data */
changed = nodeDeviceDefCopyFromMdevctl(olddef, owned);
- if (defined && !changed) {
+ if (was_defined && !changed) {
/* if this device was already defined and the definition
* hasn't changed, there's nothing to do for this device */
virNodeDeviceObjEndAPI(&obj);
@@ -1373,11 +1374,11 @@ nodeDeviceUpdateMediatedDevice(virNodeDeviceDef *def)
}
}
- /* all devices returned by virMdevctlListDefined() are persistent */
- virNodeDeviceObjSetPersistent(obj, true);
+ if (defined)
+ virNodeDeviceObjSetPersistent(obj, true);
virNodeDeviceObjSetAutostart(obj, def->caps->data.mdev.autostart);
- if (!defined)
+ if (!was_defined && defined)
event = virNodeDeviceEventLifecycleNew(name,
VIR_NODE_DEVICE_EVENT_DEFINED,
0);
@@ -1447,7 +1448,7 @@ nodeDeviceDefineXML(virConnect *conn,
* have already received the uuid from virMdevctlDefine(), we can simply
* add the provisional device to the list and return it immediately and
* avoid this long delay. */
- if (nodeDeviceUpdateMediatedDevice(g_steal_pointer(&def)) < 0)
+ if (nodeDeviceUpdateMediatedDevice(g_steal_pointer(&def), true) < 0)
return NULL;
return virGetNodeDevice(conn, name);
@@ -1742,7 +1743,7 @@ nodeDeviceUpdateMediatedDevices(void)
removeMissingPersistentMdev, &data);
for (i = 0; i < data.ndefs; i++)
- if (nodeDeviceUpdateMediatedDevice(defs[i]) < 0)
+ if (nodeDeviceUpdateMediatedDevice(defs[i], true) < 0)
return -1;
/* Update active/transient mdev devices */
@@ -1753,7 +1754,7 @@ nodeDeviceUpdateMediatedDevices(void)
}
for (i = 0; i < act_ndefs; i++)
- if (nodeDeviceUpdateMediatedDevice(act_defs[i]) < 0)
+ if (nodeDeviceUpdateMediatedDevice(act_defs[i], false) < 0)
return -1;
return 0;
--
2.41.0

View File

@ -0,0 +1,50 @@
From d993cec578f2bbb121dcacea6728cf34da14e62e Mon Sep 17 00:00:00 2001
Message-ID: <d993cec578f2bbb121dcacea6728cf34da14e62e.1689602377.git.jdenemar@redhat.com>
From: Boris Fiuczynski <fiuczy@linux.ibm.com>
Date: Fri, 30 Jun 2023 13:34:00 +0200
Subject: [PATCH] nodedev: transient mdev update on nodeDeviceCreateXML
Update the optional mdev attributes by running an mdevctl update on a
new created nodedev object representing an mdev.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2143158
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2143158
(cherry picked from commit 37481aa1f15ece6b187b8fa219966f77648c813d)
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
src/node_device/node_device_udev.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 4c37ec3189..fce4212728 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1757,12 +1757,20 @@ nodeStateCleanup(void)
static int
udevHandleOneDevice(struct udev_device *device)
{
+ virNodeDevCapType dev_cap_type;
const char *action = udev_device_get_action(device);
VIR_DEBUG("udev action: '%s': %s", action, udev_device_get_syspath(device));
- if (STREQ(action, "add") || STREQ(action, "change"))
- return udevAddOneDevice(device);
+ if (STREQ(action, "add") || STREQ(action, "change")) {
+ int ret = udevAddOneDevice(device);
+ if (ret == 0 &&
+ udevGetDeviceType(device, &dev_cap_type) == 0 &&
+ dev_cap_type == VIR_NODE_DEV_CAP_MDEV)
+ if (nodeDeviceUpdateMediatedDevices() < 0)
+ VIR_WARN("mdevctl failed to update mediated devices");
+ return ret;
+ }
if (STREQ(action, "remove"))
return udevRemoveOneDevice(device);
--
2.41.0

View File

@ -0,0 +1,70 @@
From 48813113774c7ff0ab1b43c1861b6495bb3ce830 Mon Sep 17 00:00:00 2001
Message-ID: <48813113774c7ff0ab1b43c1861b6495bb3ce830.1689602377.git.jdenemar@redhat.com>
From: Jonathon Jongsma <jjongsma@redhat.com>
Date: Thu, 6 Jul 2023 09:16:35 -0500
Subject: [PATCH] nodedev: update mdevs from the mdevctl thread
Rather than directly executing mdevctl from the udev event thread when
we determine that we need to re-query, schedule the mdevctl thread to
run. This also helps to coalesce multiple back-to-back updates into a
single one when there are multiple updates in a row or at startup when a
host has a very large number of mdevs.
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
(cherry picked from commit 14026db9b0e25739ea30685bd643ff23aca30588)
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2143158
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
src/node_device/node_device_udev.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 86ef4af728..6451574c1d 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1443,6 +1443,9 @@ udevGetDeviceDetails(struct udev_device *device,
}
+static void scheduleMdevctlUpdate(udevEventData *data, bool force);
+
+
static int
udevRemoveOneDeviceSysPath(const char *path)
{
@@ -1475,8 +1478,7 @@ udevRemoveOneDeviceSysPath(const char *path)
virNodeDeviceObjEndAPI(&obj);
/* cannot check for mdev_types since they have already been removed */
- if (nodeDeviceUpdateMediatedDevices() < 0)
- VIR_WARN("mdevctl failed to update mediated devices");
+ scheduleMdevctlUpdate(driver->privateData, false);
virObjectEventStateQueue(driver->nodeDeviceEventState, event);
return 0;
@@ -1604,8 +1606,8 @@ udevAddOneDevice(struct udev_device *device)
has_mdev_types = virNodeDeviceObjHasCap(obj, VIR_NODE_DEV_CAP_MDEV_TYPES);
virNodeDeviceObjEndAPI(&obj);
- if (has_mdev_types && nodeDeviceUpdateMediatedDevices() < 0)
- VIR_WARN("mdevctl failed to update mediated devices");
+ if (has_mdev_types)
+ scheduleMdevctlUpdate(driver->privateData, false);
ret = 0;
@@ -1767,8 +1769,7 @@ udevHandleOneDevice(struct udev_device *device)
if (ret == 0 &&
udevGetDeviceType(device, &dev_cap_type) == 0 &&
dev_cap_type == VIR_NODE_DEV_CAP_MDEV)
- if (nodeDeviceUpdateMediatedDevices() < 0)
- VIR_WARN("mdevctl failed to update mediated devices");
+ scheduleMdevctlUpdate(driver->privateData, false);
return ret;
}
--
2.41.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

View File

@ -0,0 +1,175 @@
From 5af7ae809ed21678c265a9559c9f70b90dcd31d9 Mon Sep 17 00:00:00 2001
Message-ID: <5af7ae809ed21678c265a9559c9f70b90dcd31d9.1689974710.git.jdenemar@redhat.com>
From: Boris Fiuczynski <fiuczy@linux.ibm.com>
Date: Fri, 14 Jul 2023 16:38:14 +0200
Subject: [PATCH] qemu: S390 does not provide physical address size
Commit be1b7d5b18 introduced parsing /proc/cpuinfo for "address size"
which is not including on S390 and therefore reports an internal error.
Lets remove the parsing on S390.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 8417c1394cd4deccee07235d4f7b2c54b774b08d)
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2224016
Signed-off-by: Boris Fiuczynski <bfiuczyn@redhat.com>
---
src/cpu/cpu_x86.c | 2 +-
src/qemu/qemu_capabilities.c | 2 +-
src/util/virhostcpu.c | 12 ++++++++++--
src/util/virhostcpu.h | 3 ++-
tests/domaincapsdata/qemu_4.2.0.s390x.xml | 1 -
tests/domaincapsdata/qemu_5.2.0.s390x.xml | 1 -
tests/domaincapsdata/qemu_6.0.0.s390x.xml | 1 -
tests/domaincapsdata/qemu_8.1.0.s390x.xml | 1 -
tests/domaincapsmock.c | 8 ++++++--
9 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 8d371d5501..3c0163c4d1 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -2795,7 +2795,7 @@ virCPUx86GetHost(virCPUDef *cpu,
VIR_DEBUG("Host CPU does not support invariant TSC");
}
- if (virHostCPUGetPhysAddrSize(&addrsz) == 0) {
+ if (virHostCPUGetPhysAddrSize(cpuData->arch, &addrsz) == 0) {
virCPUMaxPhysAddrDef *addr = g_new0(virCPUMaxPhysAddrDef, 1);
addr->bits = addrsz;
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 338608f0a2..85ea879f0b 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -3911,7 +3911,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCaps *qemuCaps,
}
if (virQEMUCapsTypeIsAccelerated(type))
- virHostCPUGetPhysAddrSize(&physAddrSize);
+ virHostCPUGetPhysAddrSize(hostArch, &physAddrSize);
virQEMUCapsSetHostModel(qemuCaps, type, physAddrSize, cpu, migCPU, fullCPU);
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
index 19195a1470..a15731e9ea 100644
--- a/src/util/virhostcpu.c
+++ b/src/util/virhostcpu.c
@@ -1646,10 +1646,17 @@ virHostCPUGetSignature(char **signature)
}
int
-virHostCPUGetPhysAddrSize(unsigned int *size)
+virHostCPUGetPhysAddrSize(const virArch hostArch,
+ unsigned int *size)
{
g_autoptr(FILE) cpuinfo = NULL;
+ if (ARCH_IS_S390(hostArch)) {
+ /* Ensure size is set to 0 as physical address size is unknown */
+ *size = 0;
+ return 0;
+ }
+
if (!(cpuinfo = fopen(CPUINFO_PATH, "r"))) {
virReportSystemError(errno, _("Failed to open cpuinfo file '%1$s'"),
CPUINFO_PATH);
@@ -1669,7 +1676,8 @@ virHostCPUGetSignature(char **signature)
}
int
-virHostCPUGetPhysAddrSize(unsigned int *size G_GNUC_UNUSED)
+virHostCPUGetPhysAddrSize(const virArch hostArch G_GNUC_UNUSED,
+ unsigned int *size G_GNUC_UNUSED)
{
errno = ENOSYS;
return -1;
diff --git a/src/util/virhostcpu.h b/src/util/virhostcpu.h
index 5232fee36d..5f0d43e069 100644
--- a/src/util/virhostcpu.h
+++ b/src/util/virhostcpu.h
@@ -87,7 +87,8 @@ virHostCPUTscInfo *virHostCPUGetTscInfo(void);
int virHostCPUGetSignature(char **signature);
-int virHostCPUGetPhysAddrSize(unsigned int *size);
+int virHostCPUGetPhysAddrSize(const virArch hostArch,
+ unsigned int *size);
int virHostCPUGetHaltPollTime(pid_t pid,
unsigned long long *haltPollSuccess,
diff --git a/tests/domaincapsdata/qemu_4.2.0.s390x.xml b/tests/domaincapsdata/qemu_4.2.0.s390x.xml
index da271825f9..2566f42997 100644
--- a/tests/domaincapsdata/qemu_4.2.0.s390x.xml
+++ b/tests/domaincapsdata/qemu_4.2.0.s390x.xml
@@ -38,7 +38,6 @@
</mode>
<mode name='host-model' supported='yes'>
<model fallback='forbid'>gen15a-base</model>
- <maxphysaddr mode='passthrough' limit='64'/>
<feature policy='require' name='aen'/>
<feature policy='require' name='cmmnt'/>
<feature policy='require' name='vxpdeh'/>
diff --git a/tests/domaincapsdata/qemu_5.2.0.s390x.xml b/tests/domaincapsdata/qemu_5.2.0.s390x.xml
index 99faaad866..12f38d3638 100644
--- a/tests/domaincapsdata/qemu_5.2.0.s390x.xml
+++ b/tests/domaincapsdata/qemu_5.2.0.s390x.xml
@@ -38,7 +38,6 @@
</mode>
<mode name='host-model' supported='yes'>
<model fallback='forbid'>gen15a-base</model>
- <maxphysaddr mode='passthrough' limit='64'/>
<feature policy='require' name='aen'/>
<feature policy='require' name='cmmnt'/>
<feature policy='require' name='vxpdeh'/>
diff --git a/tests/domaincapsdata/qemu_6.0.0.s390x.xml b/tests/domaincapsdata/qemu_6.0.0.s390x.xml
index df3708f801..703f729ae2 100644
--- a/tests/domaincapsdata/qemu_6.0.0.s390x.xml
+++ b/tests/domaincapsdata/qemu_6.0.0.s390x.xml
@@ -38,7 +38,6 @@
</mode>
<mode name='host-model' supported='yes'>
<model fallback='forbid'>gen15a-base</model>
- <maxphysaddr mode='passthrough' limit='64'/>
<feature policy='require' name='aen'/>
<feature policy='require' name='cmmnt'/>
<feature policy='require' name='vxpdeh'/>
diff --git a/tests/domaincapsdata/qemu_8.1.0.s390x.xml b/tests/domaincapsdata/qemu_8.1.0.s390x.xml
index d70b639503..3562e96965 100644
--- a/tests/domaincapsdata/qemu_8.1.0.s390x.xml
+++ b/tests/domaincapsdata/qemu_8.1.0.s390x.xml
@@ -38,7 +38,6 @@
</mode>
<mode name='host-model' supported='yes'>
<model fallback='forbid'>gen16a-base</model>
- <maxphysaddr mode='passthrough' limit='64'/>
<feature policy='require' name='nnpa'/>
<feature policy='require' name='aen'/>
<feature policy='require' name='cmmnt'/>
diff --git a/tests/domaincapsmock.c b/tests/domaincapsmock.c
index cecb333602..6ae0c4ad45 100644
--- a/tests/domaincapsmock.c
+++ b/tests/domaincapsmock.c
@@ -37,9 +37,13 @@ virHostCPUGetMicrocodeVersion(virArch hostArch G_GNUC_UNUSED)
}
int
-virHostCPUGetPhysAddrSize(unsigned int *size)
+virHostCPUGetPhysAddrSize(const virArch hostArch,
+ unsigned int *size)
{
- *size = 64;
+ if (ARCH_IS_S390(hostArch))
+ *size = 0;
+ else
+ *size = 64;
return 0;
}
--
2.41.0

View File

@ -0,0 +1,97 @@
From 1c1274ab6be81184ca2193a86735e2edb27aee8d Mon Sep 17 00:00:00 2001
Message-ID: <1c1274ab6be81184ca2193a86735e2edb27aee8d.1689974709.git.jdenemar@redhat.com>
From: Boris Fiuczynski <fiuczy@linux.ibm.com>
Date: Wed, 5 Jul 2023 08:20:25 +0200
Subject: [PATCH] qemu: add run-with async-teardown capability
QEMU capability is looking in query-command-line-options response for
...
{
"parameters": [
{
"name": "async-teardown",
"type": "boolean"
}
],
"option": "run-with"
}
...
allow to use the QEMU option -run-with async-teardown=on|off
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 65c6513811d1cdc7e97319164d7528411520dd0c)
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2168499
Signed-off-by: Boris Fiuczynski <bfiuczyn@redhat.com>
---
src/qemu/qemu_capabilities.c | 4 ++++
src/qemu/qemu_capabilities.h | 3 +++
tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml | 1 +
4 files changed, 9 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 7dad7231ee..c9f4b17208 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -694,6 +694,9 @@ VIR_ENUM_IMPL(virQEMUCaps,
"rbd-encryption-layering", /* QEMU_CAPS_RBD_ENCRYPTION_LAYERING */
"rbd-encryption-luks-any", /* QEMU_CAPS_RBD_ENCRYPTION_LUKS_ANY */
"qcow2-discard-no-unref", /* QEMU_CAPS_QCOW2_DISCARD_NO_UNREF */
+
+ /* 450 */
+ "run-with.async-teardown", /* QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN */
);
@@ -3369,6 +3372,7 @@ static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = {
{ "spice", "gl", QEMU_CAPS_SPICE_GL },
{ "spice", "rendernode", QEMU_CAPS_SPICE_RENDERNODE },
{ "vnc", "power-control", QEMU_CAPS_VNC_POWER_CONTROL },
+ { "run-with", "async-teardown", QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN },
};
static int
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index ce545cb2cc..2460fa7fa0 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -674,6 +674,9 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
QEMU_CAPS_RBD_ENCRYPTION_LUKS_ANY, /* luks-any (LUKS and LUKS2) encryption format for Ceph RBD */
QEMU_CAPS_QCOW2_DISCARD_NO_UNREF, /* qcow2 block driver allows discards without unrefing the sector */
+ /* 450 */
+ QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN, /* asynchronous teardown -run-with async-teardown=on|off */
+
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml
index 23b5aece15..88c7ac89db 100644
--- a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml
@@ -114,6 +114,7 @@
<flag name='virtio-gpu.blob'/>
<flag name='rbd-encryption-layering'/>
<flag name='rbd-encryption-luks-any'/>
+ <flag name='run-with.async-teardown'/>
<version>8000050</version>
<microcodeVersion>39100245</microcodeVersion>
<package>v8.0.0-1270-g1c12355b</package>
diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
index f717c83fec..475496a8c8 100644
--- a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
@@ -206,6 +206,7 @@
<flag name='rbd-encryption-layering'/>
<flag name='rbd-encryption-luks-any'/>
<flag name='qcow2-discard-no-unref'/>
+ <flag name='run-with.async-teardown'/>
<version>8000050</version>
<microcodeVersion>43100245</microcodeVersion>
<package>v8.0.0-1739-g5f9dd6a8ce</package>
--
2.41.0

View File

@ -0,0 +1,836 @@
From d216c360f9d0acda0726194aed81e145018a3951 Mon Sep 17 00:00:00 2001
Message-ID: <d216c360f9d0acda0726194aed81e145018a3951.1689974709.git.jdenemar@redhat.com>
From: Boris Fiuczynski <fiuczy@linux.ibm.com>
Date: Wed, 5 Jul 2023 08:20:26 +0200
Subject: [PATCH] qemu: allow use of async teardown in domain
Asynchronous teardown can be specified if the QEMU binary supports it by
adding in the domain XML
<features>
...
<async-teardown enabled='yes|no'/>
...
</features>
By default this new feature is disabled.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 3bf02acdc5446b2c4a3078f99d8f5232acff9043)
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2168499
Signed-off-by: Boris Fiuczynski <bfiuczyn@redhat.com>
---
docs/formatdomain.rst | 6 +++
src/conf/domain_conf.c | 22 ++++++++++
src/conf/domain_conf.h | 1 +
src/conf/schemas/domaincommon.rng | 9 ++++
src/qemu/qemu_command.c | 22 ++++++++++
src/qemu/qemu_validate.c | 9 ++++
.../async-teardown.x86_64-latest.args | 37 ++++++++++++++++
tests/qemuxml2argvdata/async-teardown.xml | 31 +++++++++++++
...0-async-teardown-disabled.s390x-6.0.0.args | 35 +++++++++++++++
...-async-teardown-disabled.s390x-latest.args | 36 +++++++++++++++
.../s390-async-teardown-disabled.xml | 24 ++++++++++
...async-teardown-no-attrib.s390x-latest.args | 36 +++++++++++++++
.../s390-async-teardown-no-attrib.xml | 24 ++++++++++
.../s390-async-teardown.s390x-6.0.0.err | 1 +
.../s390-async-teardown.s390x-latest.args | 36 +++++++++++++++
.../qemuxml2argvdata/s390-async-teardown.xml | 24 ++++++++++
tests/qemuxml2argvtest.c | 7 +++
.../async-teardown.x86_64-latest.xml | 44 +++++++++++++++++++
...90-async-teardown-disabled.s390x-6.0.0.xml | 36 +++++++++++++++
...0-async-teardown-disabled.s390x-latest.xml | 36 +++++++++++++++
...-async-teardown-no-attrib.s390x-latest.xml | 36 +++++++++++++++
.../s390-async-teardown.s390x-latest.xml | 36 +++++++++++++++
tests/qemuxml2xmltest.c | 6 +++
23 files changed, 554 insertions(+)
create mode 100644 tests/qemuxml2argvdata/async-teardown.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/async-teardown.xml
create mode 100644 tests/qemuxml2argvdata/s390-async-teardown-disabled.s390x-6.0.0.args
create mode 100644 tests/qemuxml2argvdata/s390-async-teardown-disabled.s390x-latest.args
create mode 100644 tests/qemuxml2argvdata/s390-async-teardown-disabled.xml
create mode 100644 tests/qemuxml2argvdata/s390-async-teardown-no-attrib.s390x-latest.args
create mode 100644 tests/qemuxml2argvdata/s390-async-teardown-no-attrib.xml
create mode 100644 tests/qemuxml2argvdata/s390-async-teardown.s390x-6.0.0.err
create mode 100644 tests/qemuxml2argvdata/s390-async-teardown.s390x-latest.args
create mode 100644 tests/qemuxml2argvdata/s390-async-teardown.xml
create mode 100644 tests/qemuxml2xmloutdata/async-teardown.x86_64-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/s390-async-teardown-disabled.s390x-6.0.0.xml
create mode 100644 tests/qemuxml2xmloutdata/s390-async-teardown-disabled.s390x-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/s390-async-teardown-no-attrib.s390x-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/s390-async-teardown.s390x-latest.xml
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index f29449f749..c61c8a3fec 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -2000,6 +2000,7 @@ Hypervisors may allow certain CPU / machine features to be toggled on/off.
<tcg>
<tb-cache unit='MiB'>128</tb-cache>
</tcg>
+ <async-teardown enabled='yes'/>
</features>
...
@@ -2230,6 +2231,11 @@ are:
tb-cache The size of translation block cache size an integer (a multiple of MiB) :since:`8.0.0`
=========== ============================================== =================================================== ==============
+``async-teardown``
+ Depending on the ``enabled`` attribute (values ``yes``, ``no``) enable or
+ disable QEMU asynchronous teardown to improve memory reclaiming on a guest.
+ :since:`Since 9.6.0` (QEMU only)
+
Time keeping
------------
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 4121b6a054..5ac5c0b771 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -181,6 +181,7 @@ VIR_ENUM_IMPL(virDomainFeature,
"sbbc",
"ibs",
"tcg",
+ "async-teardown",
);
VIR_ENUM_IMPL(virDomainCapabilitiesPolicy,
@@ -16689,6 +16690,20 @@ virDomainFeaturesDefParse(virDomainDef *def,
return -1;
break;
+ case VIR_DOMAIN_FEATURE_ASYNC_TEARDOWN: {
+ virTristateBool enabled;
+
+ if (virXMLPropTristateBool(nodes[i], "enabled",
+ VIR_XML_PROP_NONE, &enabled) < 0)
+ return -1;
+
+ if (enabled == VIR_TRISTATE_BOOL_ABSENT)
+ enabled = VIR_TRISTATE_BOOL_YES;
+
+ def->features[val] = enabled;
+ break;
+ }
+
case VIR_DOMAIN_FEATURE_LAST:
break;
}
@@ -20628,6 +20643,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDef *src,
case VIR_DOMAIN_FEATURE_MSRS:
case VIR_DOMAIN_FEATURE_TCG:
+ case VIR_DOMAIN_FEATURE_ASYNC_TEARDOWN:
case VIR_DOMAIN_FEATURE_LAST:
break;
}
@@ -27340,6 +27356,12 @@ virDomainDefFormatFeatures(virBuffer *buf,
virDomainFeatureTCGFormat(&childBuf, def);
break;
+ case VIR_DOMAIN_FEATURE_ASYNC_TEARDOWN:
+ if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT)
+ virBufferAsprintf(&childBuf, "<async-teardown enabled='%s'/>\n",
+ virTristateBoolTypeToString(def->features[i]));
+ break;
+
case VIR_DOMAIN_FEATURE_LAST:
break;
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index cddaa3824d..c857ba556f 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2170,6 +2170,7 @@ typedef enum {
VIR_DOMAIN_FEATURE_SBBC,
VIR_DOMAIN_FEATURE_IBS,
VIR_DOMAIN_FEATURE_TCG,
+ VIR_DOMAIN_FEATURE_ASYNC_TEARDOWN,
VIR_DOMAIN_FEATURE_LAST
} virDomainFeature;
diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
index fcf9e00600..c2f56b0490 100644
--- a/src/conf/schemas/domaincommon.rng
+++ b/src/conf/schemas/domaincommon.rng
@@ -6660,6 +6660,15 @@
<optional>
<ref name="tcgfeatures"/>
</optional>
+ <optional>
+ <element name="async-teardown">
+ <optional>
+ <attribute name="enabled">
+ <ref name="virYesNo"/>
+ </attribute>
+ </optional>
+ </element>
+ </optional>
</interleave>
</element>
</optional>
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index cde6ab4dde..ec5d8b52d4 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -10175,6 +10175,25 @@ qemuBuildCryptoCommandLine(virCommand *cmd,
}
+static int
+qemuBuildAsyncTeardownCommandLine(virCommand *cmd,
+ const virDomainDef *def,
+ virQEMUCaps *qemuCaps)
+{
+ g_autofree char *async = NULL;
+ virTristateBool enabled = def->features[VIR_DOMAIN_FEATURE_ASYNC_TEARDOWN];
+
+ if (enabled != VIR_TRISTATE_BOOL_ABSENT &&
+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN)) {
+ async = g_strdup_printf("async-teardown=%s",
+ virTristateSwitchTypeToString(enabled));
+ virCommandAddArgList(cmd, "-run-with", async, NULL);
+ }
+
+ return 0;
+}
+
+
typedef enum {
QEMU_COMMAND_DEPRECATION_BEHAVIOR_NONE = 0,
QEMU_COMMAND_DEPRECATION_BEHAVIOR_OMIT,
@@ -10530,6 +10549,9 @@ qemuBuildCommandLine(virDomainObj *vm,
if (qemuBuildCryptoCommandLine(cmd, def, qemuCaps) < 0)
return NULL;
+ if (qemuBuildAsyncTeardownCommandLine(cmd, def, qemuCaps) < 0)
+ return NULL;
+
if (cfg->logTimestamp)
virCommandAddArgList(cmd, "-msg", "timestamp=on", NULL);
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index a53729d349..7e09e2c52f 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -219,6 +219,15 @@ qemuValidateDomainDefFeatures(const virDomainDef *def,
}
break;
+ case VIR_DOMAIN_FEATURE_ASYNC_TEARDOWN:
+ if (def->features[i] == VIR_TRISTATE_BOOL_YES &&
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("asynchronous teardown is not available with this QEMU binary"));
+ return -1;
+ }
+ break;
+
case VIR_DOMAIN_FEATURE_SMM:
case VIR_DOMAIN_FEATURE_KVM:
case VIR_DOMAIN_FEATURE_XEN:
diff --git a/tests/qemuxml2argvdata/async-teardown.x86_64-latest.args b/tests/qemuxml2argvdata/async-teardown.x86_64-latest.args
new file mode 100644
index 0000000000..455382f1f0
--- /dev/null
+++ b/tests/qemuxml2argvdata/async-teardown.x86_64-latest.args
@@ -0,0 +1,37 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-x86_64 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-accel tcg \
+-cpu qemu64 \
+-m size=219136k \
+-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-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 \
+-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
+-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
+-device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-run-with async-teardown=on \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/async-teardown.xml b/tests/qemuxml2argvdata/async-teardown.xml
new file mode 100644
index 0000000000..70c1eccc55
--- /dev/null
+++ b/tests/qemuxml2argvdata/async-teardown.xml
@@ -0,0 +1,31 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <features>
+ <async-teardown enabled='yes'/>
+ </features>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='fdc' index='0'/>
+ <controller type='ide' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/s390-async-teardown-disabled.s390x-6.0.0.args b/tests/qemuxml2argvdata/s390-async-teardown-disabled.s390x-6.0.0.args
new file mode 100644
index 0000000000..57690530a2
--- /dev/null
+++ b/tests/qemuxml2argvdata/s390-async-teardown-disabled.s390x-6.0.0.args
@@ -0,0 +1,35 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-s390x \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
+-machine s390-ccw-virtio-6.0,usb=off,dump-guest-core=off,memory-backend=s390.ram \
+-accel tcg \
+-cpu qemu \
+-m size=262144k \
+-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":268435456}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 9aa4b45c-b9dd-45ef-91fe-862b27b4231f \
+-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 \
+-device virtio-serial-ccw,id=virtio-serial0,devno=fe.0.0000 \
+-chardev pty,id=charconsole0 \
+-device virtconsole,chardev=charconsole0,id=console0 \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-device virtio-balloon-ccw,id=balloon0,devno=fe.0.0001 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/s390-async-teardown-disabled.s390x-latest.args b/tests/qemuxml2argvdata/s390-async-teardown-disabled.s390x-latest.args
new file mode 100644
index 0000000000..96b18b83ce
--- /dev/null
+++ b/tests/qemuxml2argvdata/s390-async-teardown-disabled.s390x-latest.args
@@ -0,0 +1,36 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-s390x \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
+-accel tcg \
+-cpu qemu \
+-m size=262144k \
+-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":268435456}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 9aa4b45c-b9dd-45ef-91fe-862b27b4231f \
+-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 \
+-device '{"driver":"virtio-serial-ccw","id":"virtio-serial0","devno":"fe.0.0000"}' \
+-chardev pty,id=charconsole0 \
+-device '{"driver":"virtconsole","chardev":"charconsole0","id":"console0"}' \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0001"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-run-with async-teardown=off \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/s390-async-teardown-disabled.xml b/tests/qemuxml2argvdata/s390-async-teardown-disabled.xml
new file mode 100644
index 0000000000..3939be0006
--- /dev/null
+++ b/tests/qemuxml2argvdata/s390-async-teardown-disabled.xml
@@ -0,0 +1,24 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid>
+ <memory>262144</memory>
+ <currentMemory>262144</currentMemory>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <features>
+ <async-teardown enabled='no'/>
+ </features>
+ <devices>
+ <emulator>/usr/bin/qemu-system-s390x</emulator>
+ <controller type='virtio-serial' index='0'>
+ </controller>
+ <console type='pty'>
+ <target type='virtio'/>
+ </console>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/s390-async-teardown-no-attrib.s390x-latest.args b/tests/qemuxml2argvdata/s390-async-teardown-no-attrib.s390x-latest.args
new file mode 100644
index 0000000000..cc7866499f
--- /dev/null
+++ b/tests/qemuxml2argvdata/s390-async-teardown-no-attrib.s390x-latest.args
@@ -0,0 +1,36 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-s390x \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
+-accel tcg \
+-cpu qemu \
+-m size=262144k \
+-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":268435456}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 9aa4b45c-b9dd-45ef-91fe-862b27b4231f \
+-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 \
+-device '{"driver":"virtio-serial-ccw","id":"virtio-serial0","devno":"fe.0.0000"}' \
+-chardev pty,id=charconsole0 \
+-device '{"driver":"virtconsole","chardev":"charconsole0","id":"console0"}' \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0001"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-run-with async-teardown=on \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/s390-async-teardown-no-attrib.xml b/tests/qemuxml2argvdata/s390-async-teardown-no-attrib.xml
new file mode 100644
index 0000000000..e069cd41ed
--- /dev/null
+++ b/tests/qemuxml2argvdata/s390-async-teardown-no-attrib.xml
@@ -0,0 +1,24 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid>
+ <memory>262144</memory>
+ <currentMemory>262144</currentMemory>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <features>
+ <async-teardown/>
+ </features>
+ <devices>
+ <emulator>/usr/bin/qemu-system-s390x</emulator>
+ <controller type='virtio-serial' index='0'>
+ </controller>
+ <console type='pty'>
+ <target type='virtio'/>
+ </console>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/s390-async-teardown.s390x-6.0.0.err b/tests/qemuxml2argvdata/s390-async-teardown.s390x-6.0.0.err
new file mode 100644
index 0000000000..aa9a4739cb
--- /dev/null
+++ b/tests/qemuxml2argvdata/s390-async-teardown.s390x-6.0.0.err
@@ -0,0 +1 @@
+unsupported configuration: asynchronous teardown is not available with this QEMU binary
diff --git a/tests/qemuxml2argvdata/s390-async-teardown.s390x-latest.args b/tests/qemuxml2argvdata/s390-async-teardown.s390x-latest.args
new file mode 100644
index 0000000000..cc7866499f
--- /dev/null
+++ b/tests/qemuxml2argvdata/s390-async-teardown.s390x-latest.args
@@ -0,0 +1,36 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-s390x \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
+-accel tcg \
+-cpu qemu \
+-m size=262144k \
+-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":268435456}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 9aa4b45c-b9dd-45ef-91fe-862b27b4231f \
+-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 \
+-device '{"driver":"virtio-serial-ccw","id":"virtio-serial0","devno":"fe.0.0000"}' \
+-chardev pty,id=charconsole0 \
+-device '{"driver":"virtconsole","chardev":"charconsole0","id":"console0"}' \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0001"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-run-with async-teardown=on \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/s390-async-teardown.xml b/tests/qemuxml2argvdata/s390-async-teardown.xml
new file mode 100644
index 0000000000..3291b1ada3
--- /dev/null
+++ b/tests/qemuxml2argvdata/s390-async-teardown.xml
@@ -0,0 +1,24 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid>
+ <memory>262144</memory>
+ <currentMemory>262144</currentMemory>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <features>
+ <async-teardown enabled='yes'/>
+ </features>
+ <devices>
+ <emulator>/usr/bin/qemu-system-s390x</emulator>
+ <controller type='virtio-serial' index='0'>
+ </controller>
+ <console type='pty'>
+ <target type='virtio'/>
+ </console>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index c1bba779b3..9abaa72674 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2701,6 +2701,13 @@ mymain(void)
DO_TEST_CAPS_LATEST("crypto-builtin");
+ DO_TEST_CAPS_LATEST("async-teardown");
+ DO_TEST_CAPS_ARCH_LATEST("s390-async-teardown", "s390x");
+ DO_TEST_CAPS_ARCH_LATEST("s390-async-teardown-no-attrib", "s390x");
+ DO_TEST_CAPS_ARCH_VER_PARSE_ERROR("s390-async-teardown", "s390x", "6.0.0");
+ DO_TEST_CAPS_ARCH_LATEST("s390-async-teardown-disabled", "s390x");
+ DO_TEST_CAPS_ARCH_VER("s390-async-teardown-disabled", "s390x", "6.0.0");
+
qemuTestDriverFree(&driver);
virFileWrapperClearPrefixes();
diff --git a/tests/qemuxml2xmloutdata/async-teardown.x86_64-latest.xml b/tests/qemuxml2xmloutdata/async-teardown.x86_64-latest.xml
new file mode 100644
index 0000000000..e98308a9b1
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/async-teardown.x86_64-latest.xml
@@ -0,0 +1,44 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <async-teardown enabled='yes'/>
+ </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>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0' model='piix3-uhci'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='fdc' index='0'/>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='none'/>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/s390-async-teardown-disabled.s390x-6.0.0.xml b/tests/qemuxml2xmloutdata/s390-async-teardown-disabled.s390x-6.0.0.xml
new file mode 100644
index 0000000000..a53d4995f0
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/s390-async-teardown-disabled.s390x-6.0.0.xml
@@ -0,0 +1,36 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid>
+ <memory unit='KiB'>262144</memory>
+ <currentMemory unit='KiB'>262144</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio-6.0'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <async-teardown enabled='no'/>
+ </features>
+ <cpu mode='custom' match='exact' check='none'>
+ <model fallback='forbid'>qemu</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-s390x</emulator>
+ <controller type='virtio-serial' index='0'>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <console type='pty'>
+ <target type='virtio' port='0'/>
+ </console>
+ <audio id='1' type='none'/>
+ <memballoon model='virtio'>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/s390-async-teardown-disabled.s390x-latest.xml b/tests/qemuxml2xmloutdata/s390-async-teardown-disabled.s390x-latest.xml
new file mode 100644
index 0000000000..06c890cbff
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/s390-async-teardown-disabled.s390x-latest.xml
@@ -0,0 +1,36 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid>
+ <memory unit='KiB'>262144</memory>
+ <currentMemory unit='KiB'>262144</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <async-teardown enabled='no'/>
+ </features>
+ <cpu mode='custom' match='exact' check='none'>
+ <model fallback='forbid'>qemu</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-s390x</emulator>
+ <controller type='virtio-serial' index='0'>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <console type='pty'>
+ <target type='virtio' port='0'/>
+ </console>
+ <audio id='1' type='none'/>
+ <memballoon model='virtio'>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/s390-async-teardown-no-attrib.s390x-latest.xml b/tests/qemuxml2xmloutdata/s390-async-teardown-no-attrib.s390x-latest.xml
new file mode 100644
index 0000000000..510396a9a8
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/s390-async-teardown-no-attrib.s390x-latest.xml
@@ -0,0 +1,36 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid>
+ <memory unit='KiB'>262144</memory>
+ <currentMemory unit='KiB'>262144</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <async-teardown enabled='yes'/>
+ </features>
+ <cpu mode='custom' match='exact' check='none'>
+ <model fallback='forbid'>qemu</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-s390x</emulator>
+ <controller type='virtio-serial' index='0'>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <console type='pty'>
+ <target type='virtio' port='0'/>
+ </console>
+ <audio id='1' type='none'/>
+ <memballoon model='virtio'>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/s390-async-teardown.s390x-latest.xml b/tests/qemuxml2xmloutdata/s390-async-teardown.s390x-latest.xml
new file mode 100644
index 0000000000..510396a9a8
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/s390-async-teardown.s390x-latest.xml
@@ -0,0 +1,36 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid>
+ <memory unit='KiB'>262144</memory>
+ <currentMemory unit='KiB'>262144</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <async-teardown enabled='yes'/>
+ </features>
+ <cpu mode='custom' match='exact' check='none'>
+ <model fallback='forbid'>qemu</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-s390x</emulator>
+ <controller type='virtio-serial' index='0'>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <console type='pty'>
+ <target type='virtio' port='0'/>
+ </console>
+ <audio id='1' type='none'/>
+ <memballoon model='virtio'>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 565cb3e1e1..b66274beb8 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1241,6 +1241,12 @@ mymain(void)
DO_TEST_CAPS_LATEST("cpu-phys-bits-limit");
DO_TEST_CAPS_LATEST("cpu-phys-bits-emulate-bare");
+ DO_TEST_CAPS_LATEST("async-teardown");
+ DO_TEST_CAPS_ARCH_LATEST("s390-async-teardown", "s390x");
+ DO_TEST_CAPS_ARCH_LATEST("s390-async-teardown-no-attrib", "s390x");
+ DO_TEST_CAPS_ARCH_LATEST("s390-async-teardown-disabled", "s390x");
+ DO_TEST_CAPS_ARCH_VER("s390-async-teardown-disabled", "s390x", "6.0.0");
+
cleanup:
qemuTestDriverFree(&driver);
virFileWrapperClearPrefixes();
--
2.41.0

View File

@ -0,0 +1,38 @@
From 10e8a518a05922d5592d1405054aed3195aebf06 Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Fri, 18 Aug 2023 16:13:16 -0400
Subject: [PATCH] qemu: turn two multiline log messages into single line
Normally I wouldn't bother with a change like this, but I was touching
the function anyway, and wanted to leave it looking nice and tidy.
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_driver.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 5128b643642..5db42f07533 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -11418,8 +11418,7 @@ qemuNodeDeviceDetachFlags(virNodeDevicePtr dev,
*/
if (STREQ_NULLABLE(driverName, "kvm")) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
- _("'legacy KVM' device assignment is no longer "
- "supported on this system"));
+ _("'legacy KVM' device assignment is no longer supported on this system"));
return -1;
}
@@ -11430,8 +11429,7 @@ qemuNodeDeviceDetachFlags(virNodeDevicePtr dev,
if (!qemuHostdevHostSupportsPassthroughVFIO()) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
- _("VFIO device assignment is currently not "
- "supported on this system"));
+ _("VFIO device assignment is currently not supported on this system"));
return -1;
}

View File

@ -0,0 +1,56 @@
From 0a213a6808d5d076e7c9658960a13c27642a68a8 Mon Sep 17 00:00:00 2001
Message-ID: <0a213a6808d5d076e7c9658960a13c27642a68a8.1690808082.git.jdenemar@redhat.com>
From: Peter Krempa <pkrempa@redhat.com>
Date: Thu, 13 Jul 2023 16:16:37 +0200
Subject: [PATCH] storage: Fix returning of locked objects from
'virStoragePoolObjListSearch'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
CVE-2023-3750
'virStoragePoolObjListSearch' explicitly documents that it's returning
a pointer to a locked and ref'd pool that maches the lookup function.
This was not the case as in commit 0c4b391e2a9 (released in
libvirt-8.3.0) the code was accidentally converted to use 'VIR_LOCK_GUARD'
which auto-unlocked it when leaving the scope, even when the code was
originally "leaking" the lock.
Revert the corresponding conversion and add a comment that this function
is intentionally leaking a locked object.
Fixes: 0c4b391e2a9
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2221851
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 9a47442366fcf8a7b6d7422016d7bbb6764a1098)
---
src/conf/virstorageobj.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c
index 7010e97d61..59fa5da372 100644
--- a/src/conf/virstorageobj.c
+++ b/src/conf/virstorageobj.c
@@ -454,11 +454,16 @@ virStoragePoolObjListSearchCb(const void *payload,
virStoragePoolObj *obj = (virStoragePoolObj *) payload;
struct _virStoragePoolObjListSearchData *data =
(struct _virStoragePoolObjListSearchData *)opaque;
- VIR_LOCK_GUARD lock = virObjectLockGuard(obj);
+ virObjectLock(obj);
+
+ /* If we find the matching pool object we must return while the object is
+ * locked as the caller wants to return a locked object. */
if (data->searcher(obj, data->opaque))
return 1;
+ virObjectUnlock(obj);
+
return 0;
}
--
2.41.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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,127 @@
From b775a84c8e8d95cb407e56b0ee289b124027f94d Mon Sep 17 00:00:00 2001
Message-ID: <b775a84c8e8d95cb407e56b0ee289b124027f94d.1689974709.git.jdenemar@redhat.com>
From: Boris Fiuczynski <fiuczy@linux.ibm.com>
Date: Wed, 5 Jul 2023 08:20:23 +0200
Subject: [PATCH] tests: remove acpi support from s390x ccw hotplug tests
In newer QEMU libvirt combinations acpi support is no longer tolerated
and ignored. Therfore before upgrading the test capabilities to QEMU
8.1.0 replies removing the acpi feature from the domain XMLs.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit d8e95ab6b7c45acc121746e2e24edcfca3d8d8a0)
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2168499
Signed-off-by: Boris Fiuczynski <bfiuczyn@redhat.com>
---
.../qemuhotplug-base-ccw-live+ccw-virtio.xml | 1 -
...lug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml | 1 -
...plug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml | 1 -
.../qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml | 1 -
...tplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml | 1 -
.../qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml | 1 -
.../qemuhotplug-base-ccw-live-with-ccw-virtio.xml | 1 -
tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml | 1 -
8 files changed, 8 deletions(-)
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml
index 798a7ab732..6e879ded86 100644
--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml
@@ -9,7 +9,6 @@
<boot dev='hd'/>
</os>
<features>
- <acpi/>
<apic/>
<pae/>
</features>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml
index 0c76410ff1..86d8da651d 100644
--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml
@@ -9,7 +9,6 @@
<boot dev='hd'/>
</os>
<features>
- <acpi/>
<apic/>
<pae/>
</features>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml
index 5d2769c420..9b16951e46 100644
--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml
@@ -9,7 +9,6 @@
<boot dev='hd'/>
</os>
<features>
- <acpi/>
<apic/>
<pae/>
</features>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml
index 845c0e1c98..b5292a7ed2 100644
--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml
@@ -9,7 +9,6 @@
<boot dev='hd'/>
</os>
<features>
- <acpi/>
<apic/>
<pae/>
</features>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml
index 29b8fdd6c8..f37868101c 100644
--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml
@@ -9,7 +9,6 @@
<boot dev='hd'/>
</os>
<features>
- <acpi/>
<apic/>
<pae/>
</features>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml
index 29b8fdd6c8..f37868101c 100644
--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml
@@ -9,7 +9,6 @@
<boot dev='hd'/>
</os>
<features>
- <acpi/>
<apic/>
<pae/>
</features>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml
index 82402ffe1b..42f89a07a2 100644
--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml
@@ -9,7 +9,6 @@
<boot dev='hd'/>
</os>
<features>
- <acpi/>
<apic/>
<pae/>
</features>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml
index 6eb60b13a9..f0570b5cf4 100644
--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml
@@ -9,7 +9,6 @@
<boot dev='hd'/>
</os>
<features>
- <acpi/>
<apic/>
<pae/>
</features>
--
2.41.0

View File

@ -0,0 +1,99 @@
From 1bb961797153a92a40a3c517114e4920c65672d4 Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Sat, 8 Jul 2023 22:20:39 -0400
Subject: [PATCH] util: add stub driver name to virPCIDevice object
There can be many different drivers that are of the type "VFIO", so
add the driver name to the object and allow getting/setting it.
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/libvirt_private.syms | 2 ++
src/util/virpci.c | 17 +++++++++++++++++
src/util/virpci.h | 3 +++
3 files changed, 22 insertions(+)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 190bebdd625..0ca63f09552 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -3082,6 +3082,7 @@ virPCIDeviceGetManaged;
virPCIDeviceGetName;
virPCIDeviceGetRemoveSlot;
virPCIDeviceGetReprobe;
+virPCIDeviceGetStubDriverName;
virPCIDeviceGetStubDriverType;
virPCIDeviceGetUnbindFromStub;
virPCIDeviceGetUsedBy;
@@ -3108,6 +3109,7 @@ virPCIDeviceReset;
virPCIDeviceSetManaged;
virPCIDeviceSetRemoveSlot;
virPCIDeviceSetReprobe;
+virPCIDeviceSetStubDriverName;
virPCIDeviceSetStubDriverType;
virPCIDeviceSetUnbindFromStub;
virPCIDeviceSetUsedBy;
diff --git a/src/util/virpci.c b/src/util/virpci.c
index d86a81c2b1d..a53a51d55e2 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -88,6 +88,7 @@ struct _virPCIDevice {
bool managed;
virPCIStubDriver stubDriverType;
+ char *stubDriverName; /* if blank, use default for type */
/* used by reattach function */
bool unbind_from_stub;
@@ -1508,6 +1509,7 @@ virPCIDeviceCopy(virPCIDevice *dev)
copy->path = g_strdup(dev->path);
copy->used_by_drvname = g_strdup(dev->used_by_drvname);
copy->used_by_domname = g_strdup(dev->used_by_domname);
+ copy->stubDriverName = g_strdup(dev->stubDriverName);
return copy;
}
@@ -1522,6 +1524,7 @@ virPCIDeviceFree(virPCIDevice *dev)
g_free(dev->path);
g_free(dev->used_by_drvname);
g_free(dev->used_by_domname);
+ g_free(dev->stubDriverName);
g_free(dev);
}
@@ -1581,6 +1584,20 @@ virPCIDeviceGetStubDriverType(virPCIDevice *dev)
return dev->stubDriverType;
}
+void
+virPCIDeviceSetStubDriverName(virPCIDevice *dev,
+ const char *driverName)
+{
+ g_free(dev->stubDriverName);
+ dev->stubDriverName = g_strdup(driverName);
+}
+
+const char *
+virPCIDeviceGetStubDriverName(virPCIDevice *dev)
+{
+ return dev->stubDriverName;
+}
+
bool
virPCIDeviceGetUnbindFromStub(virPCIDevice *dev)
{
diff --git a/src/util/virpci.h b/src/util/virpci.h
index 485f535bc91..f8f98f39de7 100644
--- a/src/util/virpci.h
+++ b/src/util/virpci.h
@@ -137,6 +137,9 @@ bool virPCIDeviceGetManaged(virPCIDevice *dev);
void virPCIDeviceSetStubDriverType(virPCIDevice *dev,
virPCIStubDriver driverType);
virPCIStubDriver virPCIDeviceGetStubDriverType(virPCIDevice *dev);
+void virPCIDeviceSetStubDriverName(virPCIDevice *dev,
+ const char *driverName);
+const char *virPCIDeviceGetStubDriverName(virPCIDevice *dev);
virPCIDeviceAddress *virPCIDeviceGetAddress(virPCIDevice *dev);
int virPCIDeviceSetUsedBy(virPCIDevice *dev,
const char *drv_name,

View File

@ -0,0 +1,40 @@
From 928296b044647fd3cbe409db6903afc791863a90 Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Sat, 8 Jul 2023 23:05:44 -0400
Subject: [PATCH] util: honor stubDriverName when probing/binding stub driver
for a device
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/util/virpci.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/util/virpci.c b/src/util/virpci.c
index f1936795da7..1158e468bf9 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -1290,17 +1290,20 @@ virPCIDeviceUnbindFromStub(virPCIDevice *dev)
static int
virPCIDeviceBindToStub(virPCIDevice *dev)
{
- const char *stubDriverName;
+ const char *stubDriverName = dev->stubDriverName;
g_autofree char *stubDriverPath = NULL;
g_autofree char *driverLink = NULL;
- /* Check the device is configured to use one of the known stub drivers */
+
if (dev->stubDriverType == VIR_PCI_STUB_DRIVER_NONE) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("No stub driver configured for PCI device %1$s"),
dev->name);
return -1;
- } else if (!(stubDriverName = virPCIStubDriverTypeToString(dev->stubDriverType))) {
+ }
+
+ if (!stubDriverName
+ && !(stubDriverName = virPCIStubDriverTypeToString(dev->stubDriverType))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown stub driver configured for PCI device %1$s"),
dev->name);

View File

@ -0,0 +1,250 @@
From 6ce071f6097d9e96892d5a6c7bd3040f43cc925b Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Fri, 2 Jun 2023 14:34:51 -0400
Subject: [PATCH] util: permit existing binding to VFIO variant driver
Before a PCI device can be assigned to a guest with VFIO, that device
must be bound to the vfio-pci driver rather than to the device's
normal host driver. The vfio-pci driver provides APIs that permit QEMU
to perform all the necessary operations to make the device accessible
to the guest.
In the past vfio-pci was the only driver that supplied these APIs, but
there are now vendor/device-specific "VFIO variant" drivers that
provide the basic vfio-pci driver functionality/API while adding
support for device-specific operations (for example these
device-specific drivers may support live migration of certain
devices). All that is needed to make this functionality available is
to bind the vendor-specific "VFIO variant" driver to the device
(rather than the generic vfio-pci driver, which will continue to work,
just without the extra functionality).
But until now libvirt has required that all PCI devices being assigned
to a guest with VFIO specifically have the "vfio-pci" driver bound to
the device. So even if the user manually binds a shiny new
vendor-specific VFIO variant driver to the device (and puts
"managed='no'" in the config to prevent libvirt from changing the
binding), libvirt will just fail during startup of the guest (or
during hotplug) because the driver bound to the device isn't exactly
"vfio-pci".
Beginning with kernel 6.1, it's possible to determine from the sysfs
directory for a device whether the currently-bound driver is the
vfio-pci driver or a VFIO variant - the device directory will have a
subdirectory called "vfio-dev". We can use that to appropriately widen
the list of drivers that libvirt will allow for VFIO device
assignment.
This patch doesn't remove the explicit check for the exact "vfio-pci"
driver (since that would cause systems with pre-6.1 kernels to behave
incorrectly), but adds an additional check for the vfio-dev directory,
so that any VFIO variant driver is acceptable for libvirt to continue
setting up for VFIO device assignment.
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/hypervisor/virhostdev.c | 28 +++++--------
src/libvirt_private.syms | 1 +
src/util/virpci.c | 78 ++++++++++++++++++++++++++++++++++---
src/util/virpci.h | 3 ++
4 files changed, 87 insertions(+), 23 deletions(-)
diff --git a/src/hypervisor/virhostdev.c b/src/hypervisor/virhostdev.c
index 244f057c6ce..b95d6bf3d61 100644
--- a/src/hypervisor/virhostdev.c
+++ b/src/hypervisor/virhostdev.c
@@ -743,9 +743,8 @@ virHostdevPreparePCIDevicesImpl(virHostdevManager *mgr,
mgr->inactivePCIHostdevs) < 0)
goto reattachdevs;
} else {
- g_autofree char *driverPath = NULL;
- g_autofree char *driverName = NULL;
- int stub;
+ g_autofree char *drvName = NULL;
+ virPCIStubDriver drvType;
/* Unmanaged devices should already have been marked as
* inactive: if that's the case, we can simply move on */
@@ -765,19 +764,17 @@ virHostdevPreparePCIDevicesImpl(virHostdevManager *mgr,
* information about active / inactive device across
* daemon restarts has been implemented */
- if (virPCIDeviceGetCurrentDriverPathAndName(pci, &driverPath,
- &driverName) < 0) {
+ if (virPCIDeviceGetCurrentDriverNameAndType(pci, &drvName,
+ &drvType) < 0) {
goto reattachdevs;
}
- stub = virPCIStubDriverTypeFromString(driverName);
-
- if (stub > VIR_PCI_STUB_DRIVER_NONE &&
- stub < VIR_PCI_STUB_DRIVER_LAST) {
+ if (drvType > VIR_PCI_STUB_DRIVER_NONE) {
/* The device is bound to a known stub driver: store this
* information and add a copy to the inactive list */
- virPCIDeviceSetStubDriverType(pci, stub);
+ virPCIDeviceSetStubDriverType(pci, drvType);
+ virPCIDeviceSetStubDriverName(pci, drvName);
VIR_DEBUG("Adding PCI device %s to inactive list",
virPCIDeviceGetName(pci));
@@ -2291,18 +2288,13 @@ virHostdevPrepareOneNVMeDevice(virHostdevManager *hostdev_mgr,
/* Let's check if all PCI devices are NVMe disks. */
for (i = 0; i < virPCIDeviceListCount(pciDevices); i++) {
virPCIDevice *pci = virPCIDeviceListGet(pciDevices, i);
- g_autofree char *drvPath = NULL;
g_autofree char *drvName = NULL;
- int stub = VIR_PCI_STUB_DRIVER_NONE;
+ virPCIStubDriver drvType;
- if (virPCIDeviceGetCurrentDriverPathAndName(pci, &drvPath, &drvName) < 0)
+ if (virPCIDeviceGetCurrentDriverNameAndType(pci, &drvName, &drvType) < 0)
goto cleanup;
- if (drvName)
- stub = virPCIStubDriverTypeFromString(drvName);
-
- if (stub == VIR_PCI_STUB_DRIVER_VFIO ||
- STREQ_NULLABLE(drvName, "nvme"))
+ if (drvType == VIR_PCI_STUB_DRIVER_VFIO || STREQ_NULLABLE(drvName, "nvme"))
continue;
VIR_WARN("Suspicious NVMe disk assignment. PCI device "
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index cc564928170..ab049b38584 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -3074,6 +3074,7 @@ virPCIDeviceFileIterate;
virPCIDeviceFree;
virPCIDeviceGetAddress;
virPCIDeviceGetConfigPath;
+virPCIDeviceGetCurrentDriverNameAndType;
virPCIDeviceGetCurrentDriverPathAndName;
virPCIDeviceGetIOMMUGroupDev;
virPCIDeviceGetIOMMUGroupList;
diff --git a/src/util/virpci.c b/src/util/virpci.c
index e6f7554b232..253ddccabdd 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -280,6 +280,73 @@ virPCIDeviceGetCurrentDriverPathAndName(virPCIDevice *dev,
}
+/**
+ * virPCIDeviceGetCurrentDriverNameAndType:
+ * @dev: virPCIDevice object to examine
+ * @drvName: returns name of driver bound to this device (if any)
+ * @drvType: returns type of driver if it is a known stub driver type
+ *
+ * Find the name of the driver bound to @dev (if any) and the type of
+ * the driver if it is a known/recognized "stub" driver (based on the
+ * driver name).
+ *
+ * There are vfio "variant" drivers that provide all the basic
+ * functionality of the standard vfio-pci driver as well as additional
+ * stuff. As of kernel 6.1, the vfio-pci driver and all vfio variant
+ * drivers can be identified (once the driver has been bound to a
+ * device) by looking for the subdirectory "vfio-dev" in the device's
+ * sysfs directory; for example, if the directory
+ * /sys/bus/pci/devices/0000:04:11.4/vfio-dev exists, then the driver
+ * that is currently bound to PCI device 0000:04:11.4 is either
+ * vfio-pci, or a vfio-pci variant driver.
+ *
+ * Return 0 on success, -1 on failure. If -1 is returned, then an error
+ * message has been logged.
+ */
+int
+virPCIDeviceGetCurrentDriverNameAndType(virPCIDevice *dev,
+ char **drvName,
+ virPCIStubDriver *drvType)
+{
+ g_autofree char *drvPath = NULL;
+ g_autofree char *vfioDevDir = NULL;
+ int tmpType;
+
+ if (virPCIDeviceGetCurrentDriverPathAndName(dev, &drvPath, drvName) < 0)
+ return -1;
+
+ if (!*drvName) {
+ *drvType = VIR_PCI_STUB_DRIVER_NONE;
+ return 0;
+ }
+
+ tmpType = virPCIStubDriverTypeFromString(*drvName);
+
+ if (tmpType > VIR_PCI_STUB_DRIVER_NONE) {
+ *drvType = tmpType;
+ return 0; /* exact match of a known driver name (or no name) */
+ }
+
+ /* If the sysfs directory of this device contains a directory
+ * named "vfio-dev" then the currently-bound driver is a vfio
+ * variant driver.
+ */
+
+ vfioDevDir = virPCIFile(dev->name, "vfio-dev");
+
+ if (virFileIsDir(vfioDevDir)) {
+ VIR_DEBUG("Driver %s is a vfio_pci driver", *drvName);
+ *drvType = VIR_PCI_STUB_DRIVER_VFIO;
+ } else {
+ VIR_DEBUG("Driver %s is NOT a vfio_pci driver, or kernel is too old",
+ *drvName);
+ *drvType = VIR_PCI_STUB_DRIVER_NONE;
+ }
+
+ return 0;
+}
+
+
static int
virPCIDeviceConfigOpenInternal(virPCIDevice *dev, bool readonly, bool fatal)
{
@@ -1007,8 +1074,8 @@ virPCIDeviceReset(virPCIDevice *dev,
virPCIDeviceList *activeDevs,
virPCIDeviceList *inactiveDevs)
{
- g_autofree char *drvPath = NULL;
g_autofree char *drvName = NULL;
+ virPCIStubDriver drvType;
int ret = -1;
int fd = -1;
int hdrType = -1;
@@ -1034,15 +1101,16 @@ virPCIDeviceReset(virPCIDevice *dev,
* reset it whenever appropriate, so doing it ourselves would just
* be redundant.
*/
- if (virPCIDeviceGetCurrentDriverPathAndName(dev, &drvPath, &drvName) < 0)
+ if (virPCIDeviceGetCurrentDriverNameAndType(dev, &drvName, &drvType) < 0)
goto cleanup;
- if (virPCIStubDriverTypeFromString(drvName) == VIR_PCI_STUB_DRIVER_VFIO) {
- VIR_DEBUG("Device %s is bound to vfio-pci - skip reset",
- dev->name);
+ if (drvType == VIR_PCI_STUB_DRIVER_VFIO) {
+
+ VIR_DEBUG("Device %s is bound to %s - skip reset", dev->name, drvName);
ret = 0;
goto cleanup;
}
+
VIR_DEBUG("Resetting device %s", dev->name);
if ((fd = virPCIDeviceConfigOpenWrite(dev)) < 0)
diff --git a/src/util/virpci.h b/src/util/virpci.h
index 19c910202a2..faca6cf6f99 100644
--- a/src/util/virpci.h
+++ b/src/util/virpci.h
@@ -283,6 +283,9 @@ int virPCIDeviceRebind(virPCIDevice *dev);
int virPCIDeviceGetCurrentDriverPathAndName(virPCIDevice *dev,
char **path,
char **name);
+int virPCIDeviceGetCurrentDriverNameAndType(virPCIDevice *dev,
+ char **drvName,
+ virPCIStubDriver *drvType);
int virPCIDeviceIsPCIExpress(virPCIDevice *dev);
int virPCIDeviceHasPCIExpressLink(virPCIDevice *dev);

View File

@ -0,0 +1,107 @@
From 2d9c9445b9cc093c870f101eb884ddeac3ae40f7 Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Sun, 9 Jul 2023 15:00:26 -0400
Subject: [PATCH] util: probe stub driver from within function that binds to
stub driver
virPCIProbeStubDriver() and virPCIDeviceBindToStub() both have
very similar code that locally sets a driver name (based on
stubDriverType). These two functions are each also called in just one
place (virPCIDeviceDetach()), with just a small bit of validation code
in between.
To eliminate the "duplicated" code (which is going to be expanded
slightly in upcoming patches to support manually or automatically
picking a VFIO variant driver), this patch modifies
virPCIProbeStubDriver() to take the driver name as an argument
(rather than the virPCIDevice object), and calls it from within
virPCIDeviceBindToStub() (rather than from that function's caller),
using the driverName it has just figured out with the
now-not-duplicated code.
(NB: Since it could be used to probe *any* driver module, the name is
changed to virPCIProbeDriver()).
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/util/virpci.c | 33 ++++++++++++---------------------
1 file changed, 12 insertions(+), 21 deletions(-)
diff --git a/src/util/virpci.c b/src/util/virpci.c
index 253ddccabdd..f1936795da7 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -1154,28 +1154,19 @@ virPCIDeviceReset(virPCIDevice *dev,
static int
-virPCIProbeStubDriver(virPCIStubDriver driver)
+virPCIProbeDriver(const char *driverName)
{
- const char *drvname = NULL;
g_autofree char *drvpath = NULL;
g_autofree char *errbuf = NULL;
- if (driver == VIR_PCI_STUB_DRIVER_NONE ||
- !(drvname = virPCIStubDriverTypeToString(driver))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s",
- _("Attempting to use unknown stub driver"));
- return -1;
- }
-
- drvpath = virPCIDriverDir(drvname);
+ drvpath = virPCIDriverDir(driverName);
/* driver previously loaded, return */
if (virFileExists(drvpath))
return 0;
- if ((errbuf = virKModLoad(drvname))) {
- VIR_WARN("failed to load driver %s: %s", drvname, errbuf);
+ if ((errbuf = virKModLoad(driverName))) {
+ VIR_WARN("failed to load driver %s: %s", driverName, errbuf);
goto cleanup;
}
@@ -1187,14 +1178,14 @@ virPCIProbeStubDriver(virPCIStubDriver driver)
/* If we know failure was because of admin config, let's report that;
* otherwise, report a more generic failure message
*/
- if (virKModIsProhibited(drvname)) {
+ if (virKModIsProhibited(driverName)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to load PCI stub module %1$s: administratively prohibited"),
- drvname);
+ _("Failed to load PCI driver module %1$s: administratively prohibited"),
+ driverName);
} else {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to load PCI stub module %1$s"),
- drvname);
+ _("Failed to load PCI driver module %1$s"),
+ driverName);
}
return -1;
@@ -1316,6 +1307,9 @@ virPCIDeviceBindToStub(virPCIDevice *dev)
return -1;
}
+ if (virPCIProbeDriver(stubDriverName) < 0)
+ return -1;
+
stubDriverPath = virPCIDriverDir(stubDriverName);
driverLink = virPCIFile(dev->name, "driver");
@@ -1359,9 +1353,6 @@ virPCIDeviceDetach(virPCIDevice *dev,
virPCIDeviceList *activeDevs,
virPCIDeviceList *inactiveDevs)
{
- if (virPCIProbeStubDriver(dev->stubDriverType) < 0)
- return -1;
-
if (activeDevs && virPCIDeviceListFind(activeDevs, &dev->address)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Not detaching active device %1$s"), dev->name);

View File

@ -0,0 +1,132 @@
From 222b66974e8256965c089fb0f244dc1e01f708e7 Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Sat, 8 Jul 2023 23:12:09 -0400
Subject: [PATCH] util: rename virPCIDeviceGetDriverPathAndName
Instead, call it virPCIDeviceGetCurrentDriverPathAndName() to avoid
confusion with the device name that is stored in the virPCIDevice
object - that one is not necessarily the name of the current driver
for the device, but could instead be the driver that we want to be
bound to the device in the future.
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/hypervisor/virhostdev.c | 7 ++++---
src/libvirt_private.syms | 2 +-
src/util/virpci.c | 10 ++++++----
src/util/virpci.h | 6 +++---
tests/virpcitest.c | 2 +-
5 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/src/hypervisor/virhostdev.c b/src/hypervisor/virhostdev.c
index c437ca9d22d..244f057c6ce 100644
--- a/src/hypervisor/virhostdev.c
+++ b/src/hypervisor/virhostdev.c
@@ -765,9 +765,10 @@ virHostdevPreparePCIDevicesImpl(virHostdevManager *mgr,
* information about active / inactive device across
* daemon restarts has been implemented */
- if (virPCIDeviceGetDriverPathAndName(pci,
- &driverPath, &driverName) < 0)
+ if (virPCIDeviceGetCurrentDriverPathAndName(pci, &driverPath,
+ &driverName) < 0) {
goto reattachdevs;
+ }
stub = virPCIStubDriverTypeFromString(driverName);
@@ -2294,7 +2295,7 @@ virHostdevPrepareOneNVMeDevice(virHostdevManager *hostdev_mgr,
g_autofree char *drvName = NULL;
int stub = VIR_PCI_STUB_DRIVER_NONE;
- if (virPCIDeviceGetDriverPathAndName(pci, &drvPath, &drvName) < 0)
+ if (virPCIDeviceGetCurrentDriverPathAndName(pci, &drvPath, &drvName) < 0)
goto cleanup;
if (drvName)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 0ca63f09552..cc564928170 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -3074,7 +3074,7 @@ virPCIDeviceFileIterate;
virPCIDeviceFree;
virPCIDeviceGetAddress;
virPCIDeviceGetConfigPath;
-virPCIDeviceGetDriverPathAndName;
+virPCIDeviceGetCurrentDriverPathAndName;
virPCIDeviceGetIOMMUGroupDev;
virPCIDeviceGetIOMMUGroupList;
virPCIDeviceGetLinkCapSta;
diff --git a/src/util/virpci.c b/src/util/virpci.c
index a53a51d55e2..e6f7554b232 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -228,7 +228,7 @@ virPCIFile(const char *device, const char *file)
}
-/* virPCIDeviceGetDriverPathAndName - put the path to the driver
+/* virPCIDeviceGetCurrentDriverPathAndName - put the path to the driver
* directory of the driver in use for this device in @path and the
* name of the driver in @name. Both could be NULL if it's not bound
* to any driver.
@@ -236,7 +236,9 @@ virPCIFile(const char *device, const char *file)
* Return 0 for success, -1 for error.
*/
int
-virPCIDeviceGetDriverPathAndName(virPCIDevice *dev, char **path, char **name)
+virPCIDeviceGetCurrentDriverPathAndName(virPCIDevice *dev,
+ char **path,
+ char **name)
{
int ret = -1;
g_autofree char *drvlink = NULL;
@@ -1032,7 +1034,7 @@ virPCIDeviceReset(virPCIDevice *dev,
* reset it whenever appropriate, so doing it ourselves would just
* be redundant.
*/
- if (virPCIDeviceGetDriverPathAndName(dev, &drvPath, &drvName) < 0)
+ if (virPCIDeviceGetCurrentDriverPathAndName(dev, &drvPath, &drvName) < 0)
goto cleanup;
if (virPCIStubDriverTypeFromString(drvName) == VIR_PCI_STUB_DRIVER_VFIO) {
@@ -1137,7 +1139,7 @@ virPCIDeviceUnbind(virPCIDevice *dev)
g_autofree char *drvpath = NULL;
g_autofree char *driver = NULL;
- if (virPCIDeviceGetDriverPathAndName(dev, &drvpath, &driver) < 0)
+ if (virPCIDeviceGetCurrentDriverPathAndName(dev, &drvpath, &driver) < 0)
return -1;
if (!driver)
diff --git a/src/util/virpci.h b/src/util/virpci.h
index f8f98f39de7..19c910202a2 100644
--- a/src/util/virpci.h
+++ b/src/util/virpci.h
@@ -280,9 +280,9 @@ virPCIVPDResource * virPCIDeviceGetVPD(virPCIDevice *dev);
int virPCIDeviceUnbind(virPCIDevice *dev);
int virPCIDeviceRebind(virPCIDevice *dev);
-int virPCIDeviceGetDriverPathAndName(virPCIDevice *dev,
- char **path,
- char **name);
+int virPCIDeviceGetCurrentDriverPathAndName(virPCIDevice *dev,
+ char **path,
+ char **name);
int virPCIDeviceIsPCIExpress(virPCIDevice *dev);
int virPCIDeviceHasPCIExpressLink(virPCIDevice *dev);
diff --git a/tests/virpcitest.c b/tests/virpcitest.c
index 92cc8c07c6f..d69a1b51183 100644
--- a/tests/virpcitest.c
+++ b/tests/virpcitest.c
@@ -37,7 +37,7 @@ testVirPCIDeviceCheckDriver(virPCIDevice *dev, const char *expected)
g_autofree char *path = NULL;
g_autofree char *driver = NULL;
- if (virPCIDeviceGetDriverPathAndName(dev, &path, &driver) < 0)
+ if (virPCIDeviceGetCurrentDriverPathAndName(dev, &path, &driver) < 0)
return -1;
if (STRNEQ_NULLABLE(driver, expected)) {

View File

@ -0,0 +1,251 @@
From cd2843f5463d93eee00fab31fe259ad1b5b27a27 Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Sat, 8 Jul 2023 22:11:06 -0400
Subject: [PATCH] util: use "stubDriverType" instead of just "stubDriver"
In the past we just kept track of the type of the "stub driver" (the
driver that is bound to a device in order to assign it to a
guest). The next commit will add a stubDriverName to go along with
type, so lets use stubDriverType for the existing enum to make it
easier to keep track of whether we're talking about the name or the
type.
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/hypervisor/domain_driver.c | 4 ++--
src/hypervisor/virhostdev.c | 8 ++++----
src/libvirt_private.syms | 4 ++--
src/util/virnvme.c | 2 +-
src/util/virpci.c | 23 ++++++++++++-----------
src/util/virpci.h | 6 +++---
tests/virhostdevtest.c | 2 +-
tests/virpcitest.c | 8 ++++----
8 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/hypervisor/domain_driver.c b/src/hypervisor/domain_driver.c
index 66e09ffb04f..a70f75f3ae8 100644
--- a/src/hypervisor/domain_driver.c
+++ b/src/hypervisor/domain_driver.c
@@ -505,9 +505,9 @@ virDomainDriverNodeDeviceDetachFlags(virNodeDevicePtr dev,
return -1;
if (STREQ(driverName, "vfio"))
- virPCIDeviceSetStubDriver(pci, VIR_PCI_STUB_DRIVER_VFIO);
+ virPCIDeviceSetStubDriverType(pci, VIR_PCI_STUB_DRIVER_VFIO);
else if (STREQ(driverName, "xen"))
- virPCIDeviceSetStubDriver(pci, VIR_PCI_STUB_DRIVER_XEN);
+ virPCIDeviceSetStubDriverType(pci, VIR_PCI_STUB_DRIVER_XEN);
return virHostdevPCINodeDeviceDetach(hostdevMgr, pci);
}
diff --git a/src/hypervisor/virhostdev.c b/src/hypervisor/virhostdev.c
index eac34747836..c437ca9d22d 100644
--- a/src/hypervisor/virhostdev.c
+++ b/src/hypervisor/virhostdev.c
@@ -244,9 +244,9 @@ virHostdevGetPCIHostDevice(const virDomainHostdevDef *hostdev,
virPCIDeviceSetManaged(actual, hostdev->managed);
if (pcisrc->backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
- virPCIDeviceSetStubDriver(actual, VIR_PCI_STUB_DRIVER_VFIO);
+ virPCIDeviceSetStubDriverType(actual, VIR_PCI_STUB_DRIVER_VFIO);
} else if (pcisrc->backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_XEN) {
- virPCIDeviceSetStubDriver(actual, VIR_PCI_STUB_DRIVER_XEN);
+ virPCIDeviceSetStubDriverType(actual, VIR_PCI_STUB_DRIVER_XEN);
} else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("pci backend driver '%1$s' is not supported"),
@@ -679,7 +679,7 @@ virHostdevPreparePCIDevicesImpl(virHostdevManager *mgr,
for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) {
virPCIDevice *pci = virPCIDeviceListGet(pcidevs, i);
bool strict_acs_check = !!(flags & VIR_HOSTDEV_STRICT_ACS_CHECK);
- bool usesVFIO = (virPCIDeviceGetStubDriver(pci) == VIR_PCI_STUB_DRIVER_VFIO);
+ bool usesVFIO = (virPCIDeviceGetStubDriverType(pci) == VIR_PCI_STUB_DRIVER_VFIO);
struct virHostdevIsPCINodeDeviceUsedData data = {mgr, drv_name, dom_name, false};
int hdrType = -1;
@@ -776,7 +776,7 @@ virHostdevPreparePCIDevicesImpl(virHostdevManager *mgr,
/* The device is bound to a known stub driver: store this
* information and add a copy to the inactive list */
- virPCIDeviceSetStubDriver(pci, stub);
+ virPCIDeviceSetStubDriverType(pci, stub);
VIR_DEBUG("Adding PCI device %s to inactive list",
virPCIDeviceGetName(pci));
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 00cf32d49e8..190bebdd625 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -3082,7 +3082,7 @@ virPCIDeviceGetManaged;
virPCIDeviceGetName;
virPCIDeviceGetRemoveSlot;
virPCIDeviceGetReprobe;
-virPCIDeviceGetStubDriver;
+virPCIDeviceGetStubDriverType;
virPCIDeviceGetUnbindFromStub;
virPCIDeviceGetUsedBy;
virPCIDeviceGetVPD;
@@ -3108,7 +3108,7 @@ virPCIDeviceReset;
virPCIDeviceSetManaged;
virPCIDeviceSetRemoveSlot;
virPCIDeviceSetReprobe;
-virPCIDeviceSetStubDriver;
+virPCIDeviceSetStubDriverType;
virPCIDeviceSetUnbindFromStub;
virPCIDeviceSetUsedBy;
virPCIDeviceUnbind;
diff --git a/src/util/virnvme.c b/src/util/virnvme.c
index f7f8dc5ea91..37333d515b4 100644
--- a/src/util/virnvme.c
+++ b/src/util/virnvme.c
@@ -292,7 +292,7 @@ virNVMeDeviceCreatePCIDevice(const virNVMeDevice *nvme)
return NULL;
/* NVMe devices must be bound to vfio */
- virPCIDeviceSetStubDriver(pci, VIR_PCI_STUB_DRIVER_VFIO);
+ virPCIDeviceSetStubDriverType(pci, VIR_PCI_STUB_DRIVER_VFIO);
virPCIDeviceSetManaged(pci, nvme->managed);
return g_steal_pointer(&pci);
diff --git a/src/util/virpci.c b/src/util/virpci.c
index cc2b07bbba0..d86a81c2b1d 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -87,7 +87,7 @@ struct _virPCIDevice {
bool managed;
- virPCIStubDriver stubDriver;
+ virPCIStubDriver stubDriverType;
/* used by reattach function */
bool unbind_from_stub;
@@ -1233,12 +1233,12 @@ virPCIDeviceBindToStub(virPCIDevice *dev)
g_autofree char *driverLink = NULL;
/* Check the device is configured to use one of the known stub drivers */
- if (dev->stubDriver == VIR_PCI_STUB_DRIVER_NONE) {
+ if (dev->stubDriverType == VIR_PCI_STUB_DRIVER_NONE) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("No stub driver configured for PCI device %1$s"),
dev->name);
return -1;
- } else if (!(stubDriverName = virPCIStubDriverTypeToString(dev->stubDriver))) {
+ } else if (!(stubDriverName = virPCIStubDriverTypeToString(dev->stubDriverType))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown stub driver configured for PCI device %1$s"),
dev->name);
@@ -1267,9 +1267,10 @@ virPCIDeviceBindToStub(virPCIDevice *dev)
/* virPCIDeviceDetach:
*
* Detach this device from the host driver, attach it to the stub
- * driver (previously set with virPCIDeviceSetStubDriver(), and add *a
- * copy* of the object to the inactiveDevs list (if provided). This
- * function will *never* consume dev, so the caller should free it.
+ * driver (previously set with virPCIDeviceSetStubDriverType(), and
+ * add *a copy* of the object to the inactiveDevs list (if provided).
+ * This function will *never* consume dev, so the caller should free
+ * it.
*
* Returns 0 on success, -1 on failure (will fail if the device is
* already in the activeDevs list, but will be a NOP if the device is
@@ -1287,7 +1288,7 @@ virPCIDeviceDetach(virPCIDevice *dev,
virPCIDeviceList *activeDevs,
virPCIDeviceList *inactiveDevs)
{
- if (virPCIProbeStubDriver(dev->stubDriver) < 0)
+ if (virPCIProbeStubDriver(dev->stubDriverType) < 0)
return -1;
if (activeDevs && virPCIDeviceListFind(activeDevs, &dev->address)) {
@@ -1569,15 +1570,15 @@ virPCIDeviceGetManaged(virPCIDevice *dev)
}
void
-virPCIDeviceSetStubDriver(virPCIDevice *dev, virPCIStubDriver driver)
+virPCIDeviceSetStubDriverType(virPCIDevice *dev, virPCIStubDriver driverType)
{
- dev->stubDriver = driver;
+ dev->stubDriverType = driverType;
}
virPCIStubDriver
-virPCIDeviceGetStubDriver(virPCIDevice *dev)
+virPCIDeviceGetStubDriverType(virPCIDevice *dev)
{
- return dev->stubDriver;
+ return dev->stubDriverType;
}
bool
diff --git a/src/util/virpci.h b/src/util/virpci.h
index 4d9193f24e5..485f535bc91 100644
--- a/src/util/virpci.h
+++ b/src/util/virpci.h
@@ -134,9 +134,9 @@ int virPCIDeviceReset(virPCIDevice *dev,
void virPCIDeviceSetManaged(virPCIDevice *dev,
bool managed);
bool virPCIDeviceGetManaged(virPCIDevice *dev);
-void virPCIDeviceSetStubDriver(virPCIDevice *dev,
- virPCIStubDriver driver);
-virPCIStubDriver virPCIDeviceGetStubDriver(virPCIDevice *dev);
+void virPCIDeviceSetStubDriverType(virPCIDevice *dev,
+ virPCIStubDriver driverType);
+virPCIStubDriver virPCIDeviceGetStubDriverType(virPCIDevice *dev);
virPCIDeviceAddress *virPCIDeviceGetAddress(virPCIDevice *dev);
int virPCIDeviceSetUsedBy(virPCIDevice *dev,
const char *drv_name,
diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c
index ee0d1c1e6b8..04e6c009081 100644
--- a/tests/virhostdevtest.c
+++ b/tests/virhostdevtest.c
@@ -142,7 +142,7 @@ myInit(void)
if (!(dev[i] = virPCIDeviceNew(&subsys->u.pci.addr)))
goto cleanup;
- virPCIDeviceSetStubDriver(dev[i], VIR_PCI_STUB_DRIVER_VFIO);
+ virPCIDeviceSetStubDriverType(dev[i], VIR_PCI_STUB_DRIVER_VFIO);
}
for (i = 0; i < ndisks; i++) {
diff --git a/tests/virpcitest.c b/tests/virpcitest.c
index 769175d7c46..92cc8c07c6f 100644
--- a/tests/virpcitest.c
+++ b/tests/virpcitest.c
@@ -107,7 +107,7 @@ testVirPCIDeviceDetach(const void *opaque G_GNUC_UNUSED)
if (!(dev[i] = virPCIDeviceNew(&devAddr)))
goto cleanup;
- virPCIDeviceSetStubDriver(dev[i], VIR_PCI_STUB_DRIVER_VFIO);
+ virPCIDeviceSetStubDriverType(dev[i], VIR_PCI_STUB_DRIVER_VFIO);
if (virPCIDeviceDetach(dev[i], activeDevs, inactiveDevs) < 0)
goto cleanup;
@@ -149,7 +149,7 @@ testVirPCIDeviceReset(const void *opaque G_GNUC_UNUSED)
if (!(dev[i] = virPCIDeviceNew(&devAddr)))
goto cleanup;
- virPCIDeviceSetStubDriver(dev[i], VIR_PCI_STUB_DRIVER_VFIO);
+ virPCIDeviceSetStubDriverType(dev[i], VIR_PCI_STUB_DRIVER_VFIO);
if (virPCIDeviceReset(dev[i], activeDevs, inactiveDevs) < 0)
goto cleanup;
@@ -190,7 +190,7 @@ testVirPCIDeviceReattach(const void *opaque G_GNUC_UNUSED)
CHECK_LIST_COUNT(activeDevs, 0);
CHECK_LIST_COUNT(inactiveDevs, i + 1);
- virPCIDeviceSetStubDriver(dev[i], VIR_PCI_STUB_DRIVER_VFIO);
+ virPCIDeviceSetStubDriverType(dev[i], VIR_PCI_STUB_DRIVER_VFIO);
}
CHECK_LIST_COUNT(activeDevs, 0);
@@ -249,7 +249,7 @@ testVirPCIDeviceDetachSingle(const void *opaque)
if (!dev)
goto cleanup;
- virPCIDeviceSetStubDriver(dev, VIR_PCI_STUB_DRIVER_VFIO);
+ virPCIDeviceSetStubDriverType(dev, VIR_PCI_STUB_DRIVER_VFIO);
if (virPCIDeviceDetach(dev, NULL, NULL) < 0)
goto cleanup;

View File

@ -1,5 +1,6 @@
.ctags.d/libvirt.ctags ../.ctags
tests/virt-admin-self-test ./virsh-self-test
tests/chxml2xmlout/basic.xml ../chxml2xmlin/basic.xml
tests/genericxml2xmloutdata/device-backenddomain.xml ../genericxml2xmlindata/device-backenddomain.xml
tests/networkxml2xmlin/leasetime-hours.xml ../networkxml2confdata/leasetime-hours.xml
tests/networkxml2xmlin/leasetime-infinite.xml ../networkxml2confdata/leasetime-infinite.xml
@ -62,6 +63,10 @@ tests/qemublocktestdata/imagecreate/qcow2-luks-encopts-backing.xml qcow2-luks-en
tests/qemufirmwaredata/etc/qemu/firmware/40-ovmf-sb-keys.json ../../../usr/share/qemu/firmware/50-ovmf-sb-keys.json
tests/qemuhotplugtestdomains/qemuhotplug-base-live+ivshmem-doorbell-detach.xml qemuhotplug-base-live+ivshmem-plain.xml
tests/qemuhotplugtestdomains/qemuhotplug-base-live+ivshmem-plain-detach.xml qemuhotplug-base-live.xml
tests/qemuhotplugtestdomains/qemuhotplug-base-live+watchdog+watchdog-reset.xml qemuhotplug-base-live+watchdog.xml
tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom+disk-cdrom-nochange.xml qemuhotplug-disk-cdrom.xml
tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice+graphics-spice-nochange.xml qemuhotplug-graphics-spice.xml
tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice-timeout+graphics-spice-timeout-nochange.xml qemuhotplug-graphics-spice-timeout.xml
tests/qemustatusxml2xmldata/backup-pull-out.xml backup-pull-in.xml
tests/qemustatusxml2xmldata/blockjob-blockdev-out.xml blockjob-blockdev-in.xml
tests/qemustatusxml2xmldata/blockjob-mirror-out.xml blockjob-mirror-in.xml
@ -73,97 +78,39 @@ tests/qemustatusxml2xmldata/vcpus-multi-out.xml vcpus-multi-in.xml
tests/qemuvhostuserdata/etc/qemu/vhost-user/40-gpu.json ../../../usr/share/qemu/vhost-user/50-gpu.json
tests/qemuvhostuserdata/usr/share/qemu/vhost-user/30-gpu.json 50-gpu.json
tests/qemuvhostuserdata/usr/share/qemu/vhost-user/60-gpu.json 50-gpu.json
tests/qemuxml2argvdata/aarch64-gic-default-both.args aarch64-gic-v3.args
tests/qemuxml2argvdata/aarch64-gic-default-both.xml aarch64-gic-default.xml
tests/qemuxml2argvdata/aarch64-gic-default-v2.args aarch64-gic-v2.args
tests/qemuxml2argvdata/aarch64-gic-default-v2.xml aarch64-gic-default.xml
tests/qemuxml2argvdata/aarch64-gic-default-v3.args aarch64-gic-v3.args
tests/qemuxml2argvdata/aarch64-gic-default-v3.xml aarch64-gic-default.xml
tests/qemuxml2argvdata/aarch64-gic-default.args aarch64-gic-v2.args
tests/qemuxml2argvdata/aarch64-gic-none-both.args aarch64-gic-v3.args
tests/qemuxml2argvdata/aarch64-gic-none-both.xml aarch64-gic-none.xml
tests/qemuxml2argvdata/aarch64-gic-none-v2.args aarch64-gic-v2.args
tests/qemuxml2argvdata/aarch64-gic-none-v2.xml aarch64-gic-none.xml
tests/qemuxml2argvdata/aarch64-gic-none-v3.args aarch64-gic-v3.args
tests/qemuxml2argvdata/aarch64-gic-none-v3.xml aarch64-gic-none-v2.xml
tests/qemuxml2argvdata/aarch64-gic-none.args aarch64-gic-v2.args
tests/qemuxml2argvdata/cpu-check-full.args cpu-check-none.args
tests/qemuxml2argvdata/cpu-check-partial.args cpu-check-none.args
tests/qemuxml2argvdata/cpu-numa-memshared-1.xml cpu-numa-memshared.xml
tests/qemuxml2argvdata/disk-backing-chains-index.x86_64-latest.args disk-backing-chains-noindex.x86_64-latest.args
tests/qemuxml2argvdata/disk-backing-chains-noindex.x86_64-4.1.0.args disk-backing-chains-index.x86_64-4.1.0.args
tests/qemuxml2argvdata/mach-virt-console-native.args mach-virt-serial-native.args
tests/qemuxml2argvdata/mach-virt-serial+console-native.args mach-virt-serial-native.args
tests/qemuxml2argvdata/mach-virt-serial-compat.args mach-virt-serial-native.args
tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64-abi-update.xml memory-hotplug-nvdimm-ppc64.xml
tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma-abi-update.xml memory-hotplug-ppc64-nonuma.xml
tests/qemuxml2argvdata/pci-rom-disabled-invalid.args pci-rom-disabled.args
tests/qemuxml2argvdata/ppc64-usb-controller-legacy.xml ppc64-usb-controller.xml
tests/qemuxml2argvdata/ppc64-usb-controller-qemu-xhci.xml ppc64-usb-controller.xml
tests/qemuxml2argvdata/pseries-console-native.args pseries-serial-native.args
tests/qemuxml2argvdata/pseries-features-ccf.xml pseries-features.xml
tests/qemuxml2argvdata/pseries-features-cfpc.xml pseries-features.xml
tests/qemuxml2argvdata/pseries-features-hpt-pagesize.xml pseries-features.xml
tests/qemuxml2argvdata/pseries-features-htm.xml pseries-features.xml
tests/qemuxml2argvdata/pseries-features-ibs.xml pseries-features.xml
tests/qemuxml2argvdata/pseries-features-nested-hv.xml pseries-features.xml
tests/qemuxml2argvdata/pseries-features-sbbc.xml pseries-features.xml
tests/qemuxml2argvdata/pseries-serial+console-native.args pseries-serial-native.args
tests/qemuxml2argvdata/pseries-serial-compat.args pseries-serial-native.args
tests/qemuxml2argvdata/q35-virtio-pci.xml q35-pcie.xml
tests/qemuxml2argvdata/pseries-console-native.ppc64-latest.args pseries-serial-native.ppc64-latest.args
tests/qemuxml2argvdata/pseries-serial+console-native.ppc64-latest.args pseries-serial-native.ppc64-latest.args
tests/qemuxml2argvdata/pseries-serial-compat.ppc64-latest.args pseries-serial-native.ppc64-latest.args
tests/qemuxml2argvdata/usb-controller-default-unavailable-q35.xml usb-controller-default-q35.xml
tests/qemuxml2argvdata/usb-controller-explicit-unavailable-q35.xml usb-controller-explicit-q35.xml
tests/qemuxml2argvdata/usb-controller-qemu-xhci-unavailable.xml usb-controller-qemu-xhci.xml
tests/qemuxml2argvdata/user-aliases2.args boot-floppy-q35.args
tests/qemuxml2xmloutdata/aarch64-gic-default-both.xml ../qemuxml2argvdata/aarch64-gic-v3.xml
tests/qemuxml2xmloutdata/aarch64-gic-default-v2.xml ../qemuxml2argvdata/aarch64-gic-v2.xml
tests/qemuxml2xmloutdata/aarch64-gic-default-v3.xml ../qemuxml2argvdata/aarch64-gic-v3.xml
tests/qemuxml2xmloutdata/aarch64-gic-default.xml ../qemuxml2argvdata/aarch64-gic-v2.xml
tests/qemuxml2xmloutdata/aarch64-gic-host.xml ../qemuxml2argvdata/aarch64-gic-host.xml
tests/qemuxml2xmloutdata/aarch64-gic-none-both.xml ../qemuxml2argvdata/aarch64-gic-v3.xml
tests/qemuxml2xmloutdata/aarch64-gic-none-v2.xml ../qemuxml2argvdata/aarch64-gic-v2.xml
tests/qemuxml2xmloutdata/aarch64-gic-none-v3.xml ../qemuxml2argvdata/aarch64-gic-v3.xml
tests/qemuxml2xmloutdata/aarch64-gic-none.xml ../qemuxml2argvdata/aarch64-gic-v2.xml
tests/qemuxml2xmloutdata/aarch64-gic-v2.xml ../qemuxml2argvdata/aarch64-gic-v2.xml
tests/qemuxml2xmloutdata/aarch64-gic-v3.xml ../qemuxml2argvdata/aarch64-gic-v3.xml
tests/qemuxml2xmloutdata/audio-alsa-best.xml ../qemuxml2argvdata/audio-alsa-best.xml
tests/qemuxml2xmloutdata/audio-alsa-full.xml ../qemuxml2argvdata/audio-alsa-full.xml
tests/qemuxml2xmloutdata/audio-alsa-minimal.xml ../qemuxml2argvdata/audio-alsa-minimal.xml
tests/qemuxml2xmloutdata/audio-coreaudio-best.xml ../qemuxml2argvdata/audio-coreaudio-best.xml
tests/qemuxml2xmloutdata/audio-coreaudio-full.xml ../qemuxml2argvdata/audio-coreaudio-full.xml
tests/qemuxml2xmloutdata/audio-coreaudio-minimal.xml ../qemuxml2argvdata/audio-coreaudio-minimal.xml
tests/qemuxml2xmloutdata/audio-file-best.xml ../qemuxml2argvdata/audio-file-best.xml
tests/qemuxml2xmloutdata/audio-file-full.xml ../qemuxml2argvdata/audio-file-full.xml
tests/qemuxml2xmloutdata/audio-file-minimal.xml ../qemuxml2argvdata/audio-file-minimal.xml
tests/qemuxml2xmloutdata/audio-jack-full.xml ../qemuxml2argvdata/audio-jack-full.xml
tests/qemuxml2xmloutdata/audio-many-backends.x86_64-latest.xml ../qemuxml2argvdata/audio-many-backends.xml
tests/qemuxml2xmloutdata/audio-none-best.xml ../qemuxml2argvdata/audio-none-best.xml
tests/qemuxml2xmloutdata/audio-none-full.xml ../qemuxml2argvdata/audio-none-full.xml
tests/qemuxml2xmloutdata/audio-none-minimal.xml ../qemuxml2argvdata/audio-none-minimal.xml
tests/qemuxml2xmloutdata/audio-oss-best.xml ../qemuxml2argvdata/audio-oss-best.xml
tests/qemuxml2xmloutdata/audio-oss-full.xml ../qemuxml2argvdata/audio-oss-full.xml
tests/qemuxml2xmloutdata/audio-oss-minimal.xml ../qemuxml2argvdata/audio-oss-minimal.xml
tests/qemuxml2xmloutdata/audio-pulseaudio-best.xml ../qemuxml2argvdata/audio-pulseaudio-best.xml
tests/qemuxml2xmloutdata/audio-pulseaudio-full.xml ../qemuxml2argvdata/audio-pulseaudio-full.xml
tests/qemuxml2xmloutdata/audio-pulseaudio-minimal.xml ../qemuxml2argvdata/audio-pulseaudio-minimal.xml
tests/qemuxml2xmloutdata/audio-sdl-best.xml ../qemuxml2argvdata/audio-sdl-best.xml
tests/qemuxml2xmloutdata/audio-sdl-full.xml ../qemuxml2argvdata/audio-sdl-full.xml
tests/qemuxml2xmloutdata/audio-sdl-minimal.xml ../qemuxml2argvdata/audio-sdl-minimal.xml
tests/qemuxml2xmloutdata/audio-spice-best.xml ../qemuxml2argvdata/audio-spice-best.xml
tests/qemuxml2xmloutdata/audio-spice-full.xml ../qemuxml2argvdata/audio-spice-full.xml
tests/qemuxml2xmloutdata/audio-spice-minimal.xml ../qemuxml2argvdata/audio-spice-minimal.xml
tests/qemuxml2xmloutdata/blkdeviotune-group-num.x86_64-latest.xml ../qemuxml2argvdata/blkdeviotune-group-num.xml
tests/qemuxml2xmloutdata/blkdeviotune-max-length.x86_64-latest.xml ../qemuxml2argvdata/blkdeviotune-max-length.xml
tests/qemuxml2xmloutdata/blkdeviotune-max.x86_64-latest.xml ../qemuxml2argvdata/blkdeviotune-max.xml
tests/qemuxml2xmloutdata/boot-floppy-q35.xml ../qemuxml2argvdata/boot-floppy-q35.xml
tests/qemuxml2xmloutdata/clock-realtime.xml ../qemuxml2argvdata/clock-realtime.xml
tests/qemuxml2xmloutdata/clock-timer-armvtimer.aarch64-latest.xml ../qemuxml2argvdata/clock-timer-armvtimer.xml
tests/qemuxml2xmloutdata/crypto-builtin.x86_64-latest.xml ../qemuxml2argvdata/crypto-builtin.xml
tests/qemuxml2xmloutdata/disk-detect-zeroes.x86_64-latest.xml ../qemuxml2argvdata/disk-detect-zeroes.xml
tests/qemuxml2xmloutdata/disk-nvme.xml ../qemuxml2argvdata/disk-nvme.xml
tests/qemuxml2xmloutdata/disk-nvme.x86_64-latest.xml ../qemuxml2argvdata/disk-nvme.xml
tests/qemuxml2xmloutdata/disk-virtio-queues.x86_64-latest.xml ../qemuxml2argvdata/disk-virtio-queues.xml
tests/qemuxml2xmloutdata/disk-virtio-scsi-reservations.xml ../qemuxml2argvdata/disk-virtio-scsi-reservations.xml
tests/qemuxml2xmloutdata/downscript.xml ../qemuxml2argvdata/downscript.xml
tests/qemuxml2xmloutdata/encrypted-disk-usage.xml ../qemuxml2argvdata/encrypted-disk-usage.xml
tests/qemuxml2xmloutdata/encrypted-disk-usage.x86_64-latest.xml ../qemuxml2argvdata/encrypted-disk-usage.xml
tests/qemuxml2xmloutdata/fd-memory-no-numa-topology.xml ../qemuxml2argvdata/fd-memory-no-numa-topology.xml
tests/qemuxml2xmloutdata/fd-memory-numa-topology.xml ../qemuxml2argvdata/fd-memory-numa-topology.xml
tests/qemuxml2xmloutdata/fd-memory-numa-topology2.xml ../qemuxml2argvdata/fd-memory-numa-topology2.xml
@ -174,12 +121,19 @@ tests/qemuxml2xmloutdata/graphics-dbus-audio.xml ../qemuxml2argvdata/graphics-db
tests/qemuxml2xmloutdata/graphics-dbus-chardev.xml ../qemuxml2argvdata/graphics-dbus-chardev.xml
tests/qemuxml2xmloutdata/graphics-dbus-p2p.xml ../qemuxml2argvdata/graphics-dbus-p2p.xml
tests/qemuxml2xmloutdata/graphics-dbus.xml ../qemuxml2argvdata/graphics-dbus.xml
tests/qemuxml2xmloutdata/hugepages-default-2M.xml ../qemuxml2argvdata/hugepages-default-2M.xml
tests/qemuxml2xmloutdata/hugepages-default-system-size.xml ../qemuxml2argvdata/hugepages-default-system-size.xml
tests/qemuxml2xmloutdata/hugepages-memaccess.xml ../qemuxml2argvdata/hugepages-memaccess.xml
tests/qemuxml2xmloutdata/hugepages-memaccess2.xml ../qemuxml2argvdata/hugepages-memaccess2.xml
tests/qemuxml2xmloutdata/hugepages-numa-default-dimm.xml ../qemuxml2argvdata/hugepages-numa-default-dimm.xml
tests/qemuxml2xmloutdata/hugepages-nvdimm.xml ../qemuxml2argvdata/hugepages-nvdimm.xml
tests/qemuxml2xmloutdata/hugepages-default-2M.x86_64-latest.xml ../qemuxml2argvdata/hugepages-default-2M.xml
tests/qemuxml2xmloutdata/hugepages-default-system-size.x86_64-latest.xml ../qemuxml2argvdata/hugepages-default-system-size.xml
tests/qemuxml2xmloutdata/hugepages-default.x86_64-latest.xml ../qemuxml2argvdata/hugepages-default.xml
tests/qemuxml2xmloutdata/hugepages-memaccess.x86_64-latest.xml ../qemuxml2argvdata/hugepages-memaccess.xml
tests/qemuxml2xmloutdata/hugepages-memaccess2.x86_64-latest.xml ../qemuxml2argvdata/hugepages-memaccess2.xml
tests/qemuxml2xmloutdata/hugepages-memaccess3.x86_64-latest.xml ../qemuxml2argvdata/hugepages-memaccess3.xml
tests/qemuxml2xmloutdata/hugepages-nodeset.x86_64-latest.xml ../qemuxml2argvdata/hugepages-nodeset.xml
tests/qemuxml2xmloutdata/hugepages-numa-default-2M.x86_64-latest.xml ../qemuxml2argvdata/hugepages-numa-default-2M.xml
tests/qemuxml2xmloutdata/hugepages-numa-default-dimm.x86_64-latest.xml ../qemuxml2argvdata/hugepages-numa-default-dimm.xml
tests/qemuxml2xmloutdata/hugepages-numa-nodeset-part.x86_64-latest.xml ../qemuxml2argvdata/hugepages-numa-nodeset-part.xml
tests/qemuxml2xmloutdata/hugepages-numa-nodeset.x86_64-latest.xml ../qemuxml2argvdata/hugepages-numa-nodeset.xml
tests/qemuxml2xmloutdata/hugepages-nvdimm.x86_64-latest.xml ../qemuxml2argvdata/hugepages-nvdimm.xml
tests/qemuxml2xmloutdata/hugepages-shared.x86_64-latest.xml ../qemuxml2argvdata/hugepages-shared.xml
tests/qemuxml2xmloutdata/input-linux.x86_64-latest.xml ../qemuxml2argvdata/input-linux.xml
tests/qemuxml2xmloutdata/intel-iommu-aw-bits.x86_64-latest.xml ../qemuxml2argvdata/intel-iommu-aw-bits.xml
tests/qemuxml2xmloutdata/intel-iommu-caching-mode.x86_64-latest.xml ../qemuxml2argvdata/intel-iommu-caching-mode.xml
@ -190,9 +144,6 @@ tests/qemuxml2xmloutdata/iothreads-ids-pool-sizes.x86_64-latest.xml ../qemuxml2a
tests/qemuxml2xmloutdata/kvm-features-off.xml ../qemuxml2argvdata/kvm-features-off.xml
tests/qemuxml2xmloutdata/kvm-features.xml ../qemuxml2argvdata/kvm-features.xml
tests/qemuxml2xmloutdata/luks-disks.x86_64-latest.xml ../qemuxml2argvdata/luks-disks.xml
tests/qemuxml2xmloutdata/mach-virt-console-native.xml mach-virt-serial-compat.xml
tests/qemuxml2xmloutdata/mach-virt-serial+console-native.xml mach-virt-serial-compat.xml
tests/qemuxml2xmloutdata/mach-virt-serial-native.xml mach-virt-serial-compat.xml
tests/qemuxml2xmloutdata/memfd-memory-default-hugepage.x86_64-latest.xml ../qemuxml2argvdata/memfd-memory-default-hugepage.xml
tests/qemuxml2xmloutdata/memfd-memory-numa.x86_64-latest.xml ../qemuxml2argvdata/memfd-memory-numa.xml
tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-access.xml ../qemuxml2argvdata/memory-hotplug-nvdimm-access.xml
@ -201,18 +152,18 @@ tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-label.xml ../qemuxml2argvdata/mem
tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-pmem.xml ../qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml
tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-readonly.xml ../qemuxml2argvdata/memory-hotplug-nvdimm-readonly.xml
tests/qemuxml2xmloutdata/memory-hotplug-nvdimm.xml ../qemuxml2argvdata/memory-hotplug-nvdimm.xml
tests/qemuxml2xmloutdata/memory-hotplug-ppc64-nonuma.xml ../qemuxml2argvdata/memory-hotplug-ppc64-nonuma.xml
tests/qemuxml2xmloutdata/memory-hotplug-virtio-mem.x86_64-latest.xml ../qemuxml2argvdata/memory-hotplug-virtio-mem.xml
tests/qemuxml2xmloutdata/memory-hotplug-virtio-pmem.x86_64-latest.xml ../qemuxml2argvdata/memory-hotplug-virtio-pmem.xml
tests/qemuxml2xmloutdata/net-mtu.xml ../qemuxml2argvdata/net-mtu.xml
tests/qemuxml2xmloutdata/net-user-addr.xml ../qemuxml2argvdata/net-user-addr.xml
tests/qemuxml2xmloutdata/net-user-passt.xml ../qemuxml2argvdata/net-user-passt.xml
tests/qemuxml2xmloutdata/net-virtio-rss.x86_64-latest.xml ../qemuxml2argvdata/net-virtio-rss.xml
tests/qemuxml2xmloutdata/net-virtio-teaming-hostdev.xml ../qemuxml2argvdata/net-virtio-teaming-hostdev.xml
tests/qemuxml2xmloutdata/numatune-hmat.xml ../qemuxml2argvdata/numatune-hmat.xml
tests/qemuxml2xmloutdata/numatune-memnode-restrictive-mode.x86_64-latest.xml ../qemuxml2argvdata/numatune-memnode-restrictive-mode.xml
tests/qemuxml2xmloutdata/numatune-no-vcpu.xml ../qemuxml2argvdata/numatune-no-vcpu.xml
tests/qemuxml2xmloutdata/os-firmware-efi-no-enrolled-keys.x86_64-latest.xml ../qemuxml2argvdata/os-firmware-efi-no-enrolled-keys.xml
tests/qemuxml2xmloutdata/pages-dimm-discard.xml ../qemuxml2argvdata/pages-dimm-discard.xml
tests/qemuxml2xmloutdata/pages-discard-hugepages.xml ../qemuxml2argvdata/pages-discard-hugepages.xml
tests/qemuxml2xmloutdata/pages-dimm-discard.x86_64-latest.xml ../qemuxml2argvdata/pages-dimm-discard.xml
tests/qemuxml2xmloutdata/pages-discard-hugepages.x86_64-latest.xml ../qemuxml2argvdata/pages-discard-hugepages.xml
tests/qemuxml2xmloutdata/pages-discard.xml ../qemuxml2argvdata/pages-discard.xml
tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-disable.x86_64-latest.xml ../qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-disable.xml
tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-enable.x86_64-latest.xml ../qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-enable.xml
@ -220,21 +171,22 @@ tests/qemuxml2xmloutdata/pseries-console-native.ppc64-latest.xml pseries-serial-
tests/qemuxml2xmloutdata/pseries-serial+console-native.ppc64-latest.xml pseries-serial-native.ppc64-latest.xml
tests/qemuxml2xmloutdata/pseries-serial-compat.ppc64-latest.xml pseries-serial-native.ppc64-latest.xml
tests/qemuxml2xmloutdata/serial-tcp-tlsx509-chardev-notls.xml ../qemuxml2argvdata/serial-tcp-tlsx509-chardev-notls.xml
tests/qemuxml2xmloutdata/sgx-epc.x86_64-7.0.0.xml ../qemuxml2argvdata/sgx-epc.xml
tests/qemuxml2xmloutdata/smbios-type-fwcfg.xml ../qemuxml2argvdata/smbios-type-fwcfg.xml
tests/qemuxml2xmloutdata/tpm-emulator-spapr.ppc64-latest.xml ../qemuxml2argvdata/tpm-emulator-spapr.xml
tests/qemuxml2xmloutdata/tpm-emulator-tpm2-enc.x86_64-latest.xml ../qemuxml2argvdata/tpm-emulator-tpm2-enc.xml
tests/qemuxml2xmloutdata/tpm-emulator-tpm2-pstate.x86_64-latest.xml ../qemuxml2argvdata/tpm-emulator-tpm2-pstate.xml
tests/qemuxml2xmloutdata/tpm-emulator-tpm2.x86_64-latest.xml ../qemuxml2argvdata/tpm-emulator-tpm2.xml
tests/qemuxml2xmloutdata/tpm-emulator.x86_64-latest.xml ../qemuxml2argvdata/tpm-emulator.xml
tests/qemuxml2xmloutdata/tpm-external.x86_64-latest.xml ../qemuxml2argvdata/tpm-external.xml
tests/qemuxml2xmloutdata/tpm-passthrough-crb.x86_64-latest.xml ../qemuxml2argvdata/tpm-passthrough-crb.xml
tests/qemuxml2xmloutdata/tpm-passthrough.x86_64-latest.xml ../qemuxml2argvdata/tpm-passthrough.xml
tests/qemuxml2xmloutdata/user-aliases.xml ../qemuxml2argvdata/user-aliases.xml
tests/qemuxml2xmloutdata/vcpu-placement-static.xml ../qemuxml2argvdata/vcpu-placement-static.xml
tests/qemuxml2xmloutdata/user-aliases.x86_64-latest.xml ../qemuxml2argvdata/user-aliases.xml
tests/qemuxml2xmloutdata/vcpu-placement-static.x86_64-latest.xml ../qemuxml2argvdata/vcpu-placement-static.xml
tests/qemuxml2xmloutdata/vhost-user-fs-fd-memory.x86_64-latest.xml ../qemuxml2argvdata/vhost-user-fs-fd-memory.xml
tests/qemuxml2xmloutdata/vhost-user-fs-hugepages.x86_64-latest.xml ../qemuxml2argvdata/vhost-user-fs-hugepages.xml
tests/qemuxml2xmloutdata/vhost-user-fs-sock.x86_64-latest.xml ../qemuxml2argvdata/vhost-user-fs-sock.xml
tests/qemuxml2xmloutdata/vhost-vsock-ccw-iommu.s390x-latest.xml ../qemuxml2argvdata/vhost-vsock-ccw-iommu.xml
tests/qemuxml2xmloutdata/vhost-vsock-ccw.xml ../qemuxml2argvdata/vhost-vsock-ccw.xml
tests/qemuxml2xmloutdata/vhost-vsock.x86_64-latest.xml ../qemuxml2argvdata/vhost-vsock.xml
tests/qemuxml2xmloutdata/video-qxl-resolution.xml ../qemuxml2argvdata/video-qxl-resolution.xml
tests/qemuxml2xmloutdata/video-virtio-vga-gpu-gl.x86_64-latest.xml ../qemuxml2argvdata/video-virtio-vga-gpu-gl.xml
@ -242,6 +194,22 @@ tests/qemuxml2xmloutdata/virtio-options.x86_64-latest.xml ../qemuxml2argvdata/vi
tests/qemuxml2xmloutdata/x86_64-default-cpu-tcg-features.x86_64-latest.xml ../qemuxml2argvdata/x86_64-default-cpu-tcg-features.xml
tests/vircaps2xmldata/linux-basic-dies/system/cpu ../../../virhostcpudata/linux-with-die/cpu
tests/vircaps2xmldata/linux-basic-dies/system/node ../../../virhostcpudata/linux-with-die/node
tests/vircaps2xmldata/linux-basic/system/cpu/cpu0/node0 ../../node/node0
tests/vircaps2xmldata/linux-basic/system/cpu/cpu1/node0 ../../node/node0
tests/vircaps2xmldata/linux-basic/system/cpu/cpu10/node2 ../../node/node2
tests/vircaps2xmldata/linux-basic/system/cpu/cpu11/node2 ../../node/node2
tests/vircaps2xmldata/linux-basic/system/cpu/cpu12/node3 ../../node/node3
tests/vircaps2xmldata/linux-basic/system/cpu/cpu13/node3 ../../node/node3
tests/vircaps2xmldata/linux-basic/system/cpu/cpu14/node3 ../../node/node3
tests/vircaps2xmldata/linux-basic/system/cpu/cpu15/node3 ../../node/node3
tests/vircaps2xmldata/linux-basic/system/cpu/cpu2/node0 ../../node/node0
tests/vircaps2xmldata/linux-basic/system/cpu/cpu3/node0 ../../node/node0
tests/vircaps2xmldata/linux-basic/system/cpu/cpu4/node1 ../../node/node1
tests/vircaps2xmldata/linux-basic/system/cpu/cpu5/node1 ../../node/node1
tests/vircaps2xmldata/linux-basic/system/cpu/cpu6/node1 ../../node/node1
tests/vircaps2xmldata/linux-basic/system/cpu/cpu7/node1 ../../node/node1
tests/vircaps2xmldata/linux-basic/system/cpu/cpu8/node2 ../../node/node2
tests/vircaps2xmldata/linux-basic/system/cpu/cpu9/node2 ../../node/node2
tests/vircaps2xmldata/linux-basic/system/node/node0/cpu0 ../../cpu/cpu0
tests/vircaps2xmldata/linux-basic/system/node/node0/cpu1 ../../cpu/cpu1
tests/vircaps2xmldata/linux-basic/system/node/node0/cpu2 ../../cpu/cpu2
@ -258,6 +226,14 @@ tests/vircaps2xmldata/linux-basic/system/node/node3/cpu12 ../../cpu/cpu12
tests/vircaps2xmldata/linux-basic/system/node/node3/cpu13 ../../cpu/cpu13
tests/vircaps2xmldata/linux-basic/system/node/node3/cpu14 ../../cpu/cpu14
tests/vircaps2xmldata/linux-basic/system/node/node3/cpu15 ../../cpu/cpu15
tests/vircaps2xmldata/linux-caches/system/cpu/cpu0/node0 ../../node/node0
tests/vircaps2xmldata/linux-caches/system/cpu/cpu1/node0 ../../node/node0
tests/vircaps2xmldata/linux-caches/system/cpu/cpu2/node0 ../../node/node0
tests/vircaps2xmldata/linux-caches/system/cpu/cpu3/node0 ../../node/node0
tests/vircaps2xmldata/linux-caches/system/cpu/cpu4/node0 ../../node/node0
tests/vircaps2xmldata/linux-caches/system/cpu/cpu5/node0 ../../node/node0
tests/vircaps2xmldata/linux-caches/system/cpu/cpu6/node0 ../../node/node0
tests/vircaps2xmldata/linux-caches/system/cpu/cpu7/node0 ../../node/node0
tests/vircaps2xmldata/linux-caches/system/node/node0/cpu0 ../../cpu/cpu0
tests/vircaps2xmldata/linux-caches/system/node/node0/cpu1 ../../cpu/cpu1
tests/vircaps2xmldata/linux-caches/system/node/node0/cpu2 ../../cpu/cpu2
@ -270,8 +246,21 @@ tests/vircaps2xmldata/linux-hmat/system/node/node0/access1/targets/node1 ../../.
tests/vircaps2xmldata/linux-resctrl-cdp/system ../linux-resctrl/system/
tests/vircaps2xmldata/linux-resctrl-cmt/system ../linux-resctrl/system
tests/vircaps2xmldata/linux-resctrl-fake-feature/system ../linux-resctrl/system
tests/vircaps2xmldata/linux-resctrl-skx-twocaches/system/cpu/cpu0/node0 ../../node/node0
tests/vircaps2xmldata/linux-resctrl-skx-twocaches/system/node/node0/cpu0 ../../cpu/cpu0
tests/vircaps2xmldata/linux-resctrl-skx/system/node/node0/cpu0 ../../cpu/cpu0
tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu0/node0 ../../node/node0
tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu1/node0 ../../node/node0
tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu10/node1 ../../node/node1
tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu11/node1 ../../node/node1
tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu2/node0 ../../node/node0
tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu3/node0 ../../node/node0
tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu4/node0 ../../node/node0
tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu5/node0 ../../node/node0
tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu6/node1 ../../node/node1
tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu7/node1 ../../node/node1
tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu8/node1 ../../node/node1
tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu9/node1 ../../node/node1
tests/vircaps2xmldata/linux-resctrl/system/node/node0/cpu0 ../../cpu/cpu0
tests/vircaps2xmldata/linux-resctrl/system/node/node0/cpu1 ../../cpu/cpu1
tests/vircaps2xmldata/linux-resctrl/system/node/node0/cpu2 ../../cpu/cpu2

File diff suppressed because it is too large Load Diff