import libvirt-8.0.0-6.module+el8.7.0+15026+c30823f5

This commit is contained in:
CentOS Sources 2022-05-03 14:03:29 +00:00 committed by Stepan Oksanichenko
parent 26a6c1c6e0
commit 0416f40251
11 changed files with 1591 additions and 1 deletions

View File

@ -0,0 +1,89 @@
From b550b671bace6d979a0763a837ce97ddf72e8fc8 Mon Sep 17 00:00:00 2001
Message-Id: <b550b671bace6d979a0763a837ce97ddf72e8fc8@dist-git>
From: Martin Kletzander <mkletzan@redhat.com>
Date: Fri, 28 Jan 2022 20:33:12 +0100
Subject: [PATCH] RHEL: Remove <glib-2.64.0 workaround for GSource race
https://bugzilla.redhat.com/show_bug.cgi?id=2045879
This is to accommodate for RHEL 8 downstream glib being fixed with a backport in
version 2.56.4-12 (Bug 1948988). Another reason for that is that our workaround
does not play nice with a fixed glib, leading to libvirt not properly
dereferencing the monitor socket, eventually leading to EMFILE: Too many open
files.
RHEL-only
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
---
src/util/glibcompat.c | 46 ++++++++-----------------------------------
1 file changed, 8 insertions(+), 38 deletions(-)
diff --git a/src/util/glibcompat.c b/src/util/glibcompat.c
index eb6dcc0111..bf890f10d2 100644
--- a/src/util/glibcompat.c
+++ b/src/util/glibcompat.c
@@ -212,51 +212,21 @@ vir_g_strdup_vprintf(const char *msg, va_list args)
return ret;
}
-
/*
- * If the last reference to a GSource is released in a non-main
- * thread we're exposed to a race condition that causes a
- * crash:
- *
- * https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1358
+ * This is a leftover of a hack that works around glib older than 2.64.0, but
+ * the fix in glib as backported in RHEL-8 to glib2-2.56.4-12 in BZ 1948988:
*
- * Thus we're using an idle func to release our ref...
+ * https://bugzilla.redhat.com/show_bug.cgi?id=1948988
*
- * ...but this imposes a significant performance penalty on
- * I/O intensive workloads which are sensitive to the iterations
- * of the event loop, so avoid the workaround if we know we have
- * new enough glib.
+ * and our workaround coupled with that glib fix started causing leaks, which
+ * surfaced with us not unreferencing the qemu monitor socket in BZ 2045879:
*
- * The function below is used from a header file definition.
+ * https://bugzilla.redhat.com/show_bug.cgi?id=2045879
*
- * Drop when min glib >= 2.64.0
+ * Keeping this wrapper makes it easier to follow with other backports without
+ * conflicts in callers due to the function name change.
*/
-#if GLIB_CHECK_VERSION(2, 64, 0)
void vir_g_source_unref(GSource *src, GMainContext *ctx G_GNUC_UNUSED)
{
g_source_unref(src);
}
-#else
-
-static gboolean
-virEventGLibSourceUnrefIdle(gpointer data)
-{
- GSource *src = data;
-
- g_source_unref(src);
-
- return FALSE;
-}
-
-void vir_g_source_unref(GSource *src, GMainContext *ctx)
-{
- GSource *idle = g_idle_source_new();
-
- g_source_set_callback(idle, virEventGLibSourceUnrefIdle, src, NULL);
-
- g_source_attach(idle, ctx);
-
- g_source_unref(idle);
-}
-
-#endif
--
2.35.1

View File

@ -0,0 +1,155 @@
From 19f7e6dc950baf346738f462ac5c6b815c04edcc Mon Sep 17 00:00:00 2001
Message-Id: <19f7e6dc950baf346738f462ac5c6b815c04edcc@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Mon, 21 Mar 2022 16:49:25 +0100
Subject: [PATCH] conf: Introduce memory allocation threads
Since its v5.0.0 release QEMU is capable of specifying number of
threads used to allocate memory. It defaults to 1, which may be
too low for humongous guests with gigantic pages.
In general, on QEMU cmd line level it is possible to use
different number of threads per each memory-backend-* object, in
practical terms it's not useful. Therefore, use <memoryBacking/>
to set guest wide value and let all memory devices 'inherit' it,
silently. IOW, don't introduce per device knob because that would
only complicate things for a little or no benefit.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
(cherry picked from commit ba7f98126fa84d354ce72929b77cc111a9a557a9)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2067126
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
docs/formatdomain.rst | 8 +++++---
docs/schemas/domaincommon.rng | 19 +++++++++++++------
src/conf/domain_conf.c | 15 ++++++++++++++-
src/conf/domain_conf.h | 1 +
tests/qemuxml2argvdata/memfd-memory-numa.xml | 2 +-
5 files changed, 34 insertions(+), 11 deletions(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 8128e43da4..17e89a0c0d 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -977,7 +977,7 @@ Memory Backing
<locked/>
<source type="file|anonymous|memfd"/>
<access mode="shared|private"/>
- <allocation mode="immediate|ondemand"/>
+ <allocation mode="immediate|ondemand" threads='8'/>
<discard/>
</memoryBacking>
...
@@ -1026,8 +1026,10 @@ influence how virtual memory pages are backed by host pages.
Using the ``mode`` attribute, specify if the memory is to be "shared" or
"private". This can be overridden per numa node by ``memAccess``.
``allocation``
- Using the ``mode`` attribute, specify when to allocate the memory by
- supplying either "immediate" or "ondemand".
+ Using the optional ``mode`` attribute, specify when to allocate the memory by
+ supplying either "immediate" or "ondemand". :since:`Since 8.2.0` it is
+ possible to set the number of threads that hypervisor uses to allocate
+ memory via ``threads`` attribute.
``discard``
When set and supported by hypervisor the memory content is discarded just
before guest shuts down (or when DIMM module is unplugged). Please note that
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 7fa5c2b8b5..c9c1529979 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -745,12 +745,19 @@
</optional>
<optional>
<element name="allocation">
- <attribute name="mode">
- <choice>
- <value>immediate</value>
- <value>ondemand</value>
- </choice>
- </attribute>
+ <optional>
+ <attribute name="mode">
+ <choice>
+ <value>immediate</value>
+ <value>ondemand</value>
+ </choice>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="threads">
+ <ref name="unsignedInt"/>
+ </attribute>
+ </optional>
</element>
</optional>
<optional>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 5691b8d2d5..805a15848e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -19095,6 +19095,13 @@ virDomainDefParseMemory(virDomainDef *def,
VIR_FREE(tmp);
}
+ if (virXPathUInt("string(./memoryBacking/allocation/@threads)",
+ ctxt, &def->mem.allocation_threads) == -2) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("Failed to parse memory allocation threads"));
+ return -1;
+ }
+
if (virXPathNode("./memoryBacking/hugepages", ctxt)) {
/* hugepages will be used */
if ((n = virXPathNodeSet("./memoryBacking/hugepages/page", ctxt, &nodes)) < 0) {
@@ -27639,6 +27646,7 @@ virDomainMemorybackingFormat(virBuffer *buf,
const virDomainMemtune *mem)
{
g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);
+ g_auto(virBuffer) allocAttrBuf = VIR_BUFFER_INITIALIZER;
if (mem->nhugepages)
virDomainHugepagesFormat(&childBuf, mem->hugepages, mem->nhugepages);
@@ -27653,8 +27661,13 @@ virDomainMemorybackingFormat(virBuffer *buf,
virBufferAsprintf(&childBuf, "<access mode='%s'/>\n",
virDomainMemoryAccessTypeToString(mem->access));
if (mem->allocation)
- virBufferAsprintf(&childBuf, "<allocation mode='%s'/>\n",
+ virBufferAsprintf(&allocAttrBuf, " mode='%s'",
virDomainMemoryAllocationTypeToString(mem->allocation));
+ if (mem->allocation_threads > 0)
+ virBufferAsprintf(&allocAttrBuf, " threads='%u'", mem->allocation_threads);
+
+ virXMLFormatElement(&childBuf, "allocation", &allocAttrBuf, NULL);
+
if (mem->discard)
virBufferAddLit(&childBuf, "<discard/>\n");
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 144ba4dd12..10af94e2e4 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2677,6 +2677,7 @@ struct _virDomainMemtune {
int source; /* enum virDomainMemorySource */
int access; /* enum virDomainMemoryAccess */
int allocation; /* enum virDomainMemoryAllocation */
+ unsigned int allocation_threads;
virTristateBool discard;
};
diff --git a/tests/qemuxml2argvdata/memfd-memory-numa.xml b/tests/qemuxml2argvdata/memfd-memory-numa.xml
index 1ebcee8939..1ac87e3aef 100644
--- a/tests/qemuxml2argvdata/memfd-memory-numa.xml
+++ b/tests/qemuxml2argvdata/memfd-memory-numa.xml
@@ -10,7 +10,7 @@
</hugepages>
<source type='memfd'/>
<access mode='shared'/>
- <allocation mode='immediate'/>
+ <allocation mode='immediate' threads='8'/>
</memoryBacking>
<vcpu placement='static'>8</vcpu>
<numatune>
--
2.35.1

View File

@ -0,0 +1,84 @@
From 71a79a215d278d83f3cd3da330e0378209983b6b Mon Sep 17 00:00:00 2001
Message-Id: <71a79a215d278d83f3cd3da330e0378209983b6b@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Wed, 26 Jan 2022 14:00:13 +0100
Subject: [PATCH] node_device: Rework udevKludgeStorageType()
The udevKludgeStorageType() function looks at devlink name
(/dev/XXX) and guesses the type of the (storage) device using a
series of STRPREFIX() calls. Well those can be turn into an array
and a for() loop, especially if we are about to add a new case
(in the next commit).
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit ec9e2adb961f2e1a121f47e7985142e827f3347b)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2056673
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/node_device/node_device_udev.c | 43 ++++++++++++++++--------------
1 file changed, 23 insertions(+), 20 deletions(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index cd1722f934..dd18401e78 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -890,32 +890,35 @@ udevProcessDASD(struct udev_device *device,
static int
udevKludgeStorageType(virNodeDeviceDef *def)
{
+ size_t i;
+ const struct {
+ const char *prefix;
+ const char *subst;
+ } fixups[] = {
+ /* virtio disk */
+ { "/dev/vd", "disk" },
+
+ /* For Direct Access Storage Devices (DASDs) there are
+ * currently no identifiers in udev besides ID_PATH. Since
+ * ID_TYPE=disk does not exist on DASDs they fall through
+ * the udevProcessStorage detection logic. */
+ { "/dev/dasd", "dasd" },
+ };
+
VIR_DEBUG("Could not find definitive storage type for device "
"with sysfs path '%s', trying to guess it",
def->sysfs_path);
- /* virtio disk */
- if (STRPREFIX(def->caps->data.storage.block, "/dev/vd")) {
- def->caps->data.storage.drive_type = g_strdup("disk");
- VIR_DEBUG("Found storage type '%s' for device "
- "with sysfs path '%s'",
- def->caps->data.storage.drive_type,
- def->sysfs_path);
- return 0;
+ for (i = 0; i < G_N_ELEMENTS(fixups); i++) {
+ if (STRPREFIX(def->caps->data.storage.block, fixups[i].prefix)) {
+ def->caps->data.storage.drive_type = g_strdup(fixups[i].subst);
+ VIR_DEBUG("Found storage type '%s' for device with sysfs path '%s'",
+ def->caps->data.storage.drive_type,
+ def->sysfs_path);
+ return 0;
+ }
}
- /* For Direct Access Storage Devices (DASDs) there are
- * currently no identifiers in udev besides ID_PATH. Since
- * ID_TYPE=disk does not exist on DASDs they fall through
- * the udevProcessStorage detection logic. */
- if (STRPREFIX(def->caps->data.storage.block, "/dev/dasd")) {
- def->caps->data.storage.drive_type = g_strdup("dasd");
- VIR_DEBUG("Found storage type '%s' for device "
- "with sysfs path '%s'",
- def->caps->data.storage.drive_type,
- def->sysfs_path);
- return 0;
- }
VIR_DEBUG("Could not determine storage type "
"for device with sysfs path '%s'", def->sysfs_path);
return -1;
--
2.35.1

View File

@ -0,0 +1,39 @@
From c04c7a986bd3514730e4169bf1a70bbec1fda006 Mon Sep 17 00:00:00 2001
Message-Id: <c04c7a986bd3514730e4169bf1a70bbec1fda006@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Wed, 26 Jan 2022 13:47:33 +0100
Subject: [PATCH] node_device: Treat NVMe disks as regular disks
Unfortunately, udev doesn't set ID_TYPE attribute for NVMe disks,
therefore we have to add another case into udevKludgeStorageType()
to treat /dev/nvme* devlinks as any other disk.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2045953
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit f103976ff34a52298df1810d82ececa3e7da4291)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2056673
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/node_device/node_device_udev.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index dd18401e78..a9e8bf10da 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -903,6 +903,11 @@ udevKludgeStorageType(virNodeDeviceDef *def)
* ID_TYPE=disk does not exist on DASDs they fall through
* the udevProcessStorage detection logic. */
{ "/dev/dasd", "dasd" },
+
+ /* NVMe disk. While strictly speaking /dev/nvme is a
+ * controller not a disk, this function is called if and
+ * only if @def is of VIR_NODE_DEV_CAP_STORAGE type. */
+ { "/dev/nvme", "disk" },
};
VIR_DEBUG("Could not find definitive storage type for device "
--
2.35.1

View File

@ -0,0 +1,72 @@
From fa7cff4e684ededd184976d4fdf217cc155825b8 Mon Sep 17 00:00:00 2001
Message-Id: <fa7cff4e684ededd184976d4fdf217cc155825b8@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Mon, 31 Jan 2022 12:55:47 +0100
Subject: [PATCH] qemu: Validate domain definition even on migration
When we are about to spawn QEMU, we validate the domain
definition against qemuCaps. Except when domain is/was already
running before (i.e. on incoming migration, snapshots, resume
from a file). However, especially on incoming migration it may
happen that the destination QEMU is different to the source
QEMU, e.g. the destination QEMU may have some devices disabled.
And we have a function that validates devices/features requested
in domain XML against the desired QEMU capabilities (aka
qemuCaps) - it's virDomainDefValidate() which calls
qemuValidateDomainDef() and qemuValidateDomainDeviceDef()
subsequently.
But the problem here is that the validation function is
explicitly skipped over in specific scenarios (like incoming
migration, restore from a snapshot or previously saved file).
This in turn means that we may spawn QEMU and request
device/features it doesn't support. When that happens QEMU fails
to load migration stream:
qemu-kvm: ... 'virtio-mem-pci' is not a valid device model name
(NB, while the example shows one particular device, the problem
is paramount)
This problem is easier to run into since we are slowly moving
validation from qemu_command.c into said validation functions.
The solution is simple: do the validation in all cases. And while
it may happen that users would be unable to migrate/restore a
guest due to a bug in our validator, spawning QEMU without
validation is worse (especially when you consider that users can
supply their own XMLs for migrate/restore operations - these were
never validated).
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2048435
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 517b8c12b98d7ac0bb4d582e0b491d50d776eb6d)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2050702
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_process.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 5c9ca0fe4f..5c6657a876 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5411,11 +5411,7 @@ qemuProcessStartValidate(virQEMUDriver *driver,
}
- /* Checks below should not be executed when starting a qemu process for a
- * VM that was running before (migration, snapshots, save). It's more
- * important to start such VM than keep the configuration clean */
- if ((flags & VIR_QEMU_PROCESS_START_NEW) &&
- virDomainDefValidate(vm->def, 0, driver->xmlopt, qemuCaps) < 0)
+ if (virDomainDefValidate(vm->def, 0, driver->xmlopt, qemuCaps) < 0)
return -1;
if (qemuProcessStartValidateGraphics(vm) < 0)
--
2.35.1

View File

@ -0,0 +1,41 @@
From ab4488be3282dd5d0b9582e6a5d1dafbe7b90489 Mon Sep 17 00:00:00 2001
Message-Id: <ab4488be3282dd5d0b9582e6a5d1dafbe7b90489@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Tue, 25 Jan 2022 17:49:00 +0100
Subject: [PATCH] qemuDomainSetupDisk: Initialize 'targetPaths'
Compiler isn't able to see that 'virDevMapperGetTargets' in cases e.g.
when the devmapper isn't available may not initialize the value in the
pointer passed as the second argument.
The usage 'qemuDomainSetupDisk' lead to an accidental infinite loop as
previous calls apparently doctored the stack to a point where
'g_slist_concat' would end up in an infinite loop trying to find the end
of the list.
Fixes: 6c49c2ee9fcb88de02cdc333f666a8e95d60a3b0
Closes: https://gitlab.com/libvirt/libvirt/-/issues/268
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
(cherry picked from commit ddb2384f0c78a91c40d95afdbc7fe325e95ef2bc)
https://bugzilla.redhat.com/show_bug.cgi?id=2046172
---
src/qemu/qemu_namespace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_namespace.c b/src/qemu/qemu_namespace.c
index 23b1160c5e..94453033f5 100644
--- a/src/qemu/qemu_namespace.c
+++ b/src/qemu/qemu_namespace.c
@@ -251,7 +251,7 @@ qemuDomainSetupDisk(virStorageSource *src,
if (!(tmpPath = virPCIDeviceAddressGetIOMMUGroupDev(&next->nvme->pciAddr)))
return -1;
} else {
- GSList *targetPaths;
+ GSList *targetPaths = NULL;
if (virStorageSourceIsEmpty(next) ||
!virStorageSourceIsLocalStorage(next)) {
--
2.35.1

View File

@ -0,0 +1,314 @@
From c387e7680c07d7dbb934dbe972e99ab78cebad28 Mon Sep 17 00:00:00 2001
Message-Id: <c387e7680c07d7dbb934dbe972e99ab78cebad28@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Mon, 21 Mar 2022 16:55:05 +0100
Subject: [PATCH] qemu_capabilities: Detect memory-backend-*.prealloc-threads
property
The prealloc-threads is property of memory-backend class which is
parent to the other three classes memory-backend-{ram,file,memfd}.
Therefore the property is present for all, or none if QEMU is
older than v5.0.0-rc0~75^2~1^2~3 which introduced the property.
Anyway, the .reserve property is the same story, and we chose
memory-backend-file to detect it, so stick with our earlier
decision and use the same backend to detect this new property.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
(cherry picked from commit a30dac15dcdb7a6c7a3e9b6cfc5cd77bae185081)
Conflicts:
src/qemu/qemu_capabilities.c: Context
src/qemu/qemu_capabilities.h
tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml
tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml
tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml
tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml
tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml
tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml
tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml
tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml
tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml
tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml
tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml
tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml
tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml
tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2067126
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml | 1 +
tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml | 1 +
tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml | 1 +
tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml | 1 +
20 files changed, 21 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 8ae80ef8d7..c4f7db55c8 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -657,6 +657,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
/* 420 */
"blockdev-reopen.__com.redhat_rhel-av-8_2_0-api", /* QEMU_CAPS_BLOCKDEV_REOPEN_COM_REDHAT_AV_8_2_0_API */
+ "memory-backend-file.prealloc-threads", /* QEMU_CAPS_MEMORY_BACKEND_PREALLOC_THREADS */
);
@@ -1713,6 +1714,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendFile[] =
* released qemu versions. */
{ "x-use-canonical-path-for-ramblock-id", QEMU_CAPS_X_USE_CANONICAL_PATH_FOR_RAMBLOCK_ID },
{ "reserve", QEMU_CAPS_MEMORY_BACKEND_RESERVE },
+ { "prealloc-threads", QEMU_CAPS_MEMORY_BACKEND_PREALLOC_THREADS },
};
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendMemfd[] = {
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index cde6c18b4c..8e65635e0d 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -636,6 +636,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
/* 420 */
QEMU_CAPS_BLOCKDEV_REOPEN_COM_REDHAT_AV_8_2_0_API, /* downstream support for blockdev reopen in rhel-av-8.2.0 */
+ QEMU_CAPS_MEMORY_BACKEND_PREALLOC_THREADS, /* -object memory-backend-*.prealloc-threads */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml
index bb6a7d5ee7..3b18f160db 100644
--- a/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml
+++ b/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml
@@ -179,6 +179,7 @@
<flag name='input-linux'/>
<flag name='query-display-options'/>
<flag name='virtio-blk.queue-size'/>
+ <flag name='memory-backend-file.prealloc-threads'/>
<version>5000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>61700241</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml
index f8317c1117..c90f2be296 100644
--- a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml
+++ b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml
@@ -187,6 +187,7 @@
<flag name='input-linux'/>
<flag name='query-display-options'/>
<flag name='virtio-blk.queue-size'/>
+ <flag name='memory-backend-file.prealloc-threads'/>
<version>5000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>42900241</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml
index 58c7eb6651..8fbe8f114f 100644
--- a/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml
+++ b/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml
@@ -171,6 +171,7 @@
<flag name='input-linux'/>
<flag name='query-display-options'/>
<flag name='virtio-blk.queue-size'/>
+ <flag name='memory-backend-file.prealloc-threads'/>
<version>5000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>0</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml
index 69f49020e7..b76c4346a4 100644
--- a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml
@@ -221,6 +221,7 @@
<flag name='input-linux'/>
<flag name='query-display-options'/>
<flag name='virtio-blk.queue-size'/>
+ <flag name='memory-backend-file.prealloc-threads'/>
<version>5000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100241</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml b/tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml
index 58af90b29f..7de7c291f5 100644
--- a/tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml
+++ b/tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml
@@ -90,6 +90,7 @@
<flag name='rotation-rate'/>
<flag name='input-linux'/>
<flag name='query-display-options'/>
+ <flag name='memory-backend-file.prealloc-threads'/>
<version>5001000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>0</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml
index 578e16e8b0..9b5cb3cd7a 100644
--- a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml
@@ -224,6 +224,7 @@
<flag name='query-display-options'/>
<flag name='virtio-blk.queue-size'/>
<flag name='virtio-mem-pci'/>
+ <flag name='memory-backend-file.prealloc-threads'/>
<version>5001000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100242</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml
index b943eaedaf..020c04c1c4 100644
--- a/tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml
+++ b/tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml
@@ -184,6 +184,7 @@
<flag name='query-display-options'/>
<flag name='virtio-blk.queue-size'/>
<flag name='query-dirty-rate'/>
+ <flag name='memory-backend-file.prealloc-threads'/>
<version>5002000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>61700243</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml
index ec64e1cacf..5346b1552c 100644
--- a/tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml
+++ b/tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml
@@ -190,6 +190,7 @@
<flag name='query-display-options'/>
<flag name='virtio-blk.queue-size'/>
<flag name='query-dirty-rate'/>
+ <flag name='memory-backend-file.prealloc-threads'/>
<version>5002000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>42900243</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml b/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml
index a11d15f91a..9f6974f85d 100644
--- a/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml
+++ b/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml
@@ -174,6 +174,7 @@
<flag name='query-display-options'/>
<flag name='virtio-blk.queue-size'/>
<flag name='query-dirty-rate'/>
+ <flag name='memory-backend-file.prealloc-threads'/>
<version>5002000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>0</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml b/tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml
index 552e1d43c9..44753b64c3 100644
--- a/tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml
@@ -141,6 +141,7 @@
<flag name='query-display-options'/>
<flag name='virtio-blk.queue-size'/>
<flag name='query-dirty-rate'/>
+ <flag name='memory-backend-file.prealloc-threads'/>
<version>5002000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>39100243</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml
index bcc262551a..db11c99739 100644
--- a/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml
@@ -227,6 +227,7 @@
<flag name='virtio-mem-pci'/>
<flag name='piix4.acpi-root-pci-hotplug'/>
<flag name='query-dirty-rate'/>
+ <flag name='memory-backend-file.prealloc-threads'/>
<version>5002000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100243</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml
index 0fefe64537..5f9a97df43 100644
--- a/tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml
+++ b/tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml
@@ -192,6 +192,7 @@
<flag name='set-action'/>
<flag name='virtio-blk.queue-size'/>
<flag name='query-dirty-rate'/>
+ <flag name='memory-backend-file.prealloc-threads'/>
<version>6000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>61700242</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml b/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml
index 61685066b8..46bd1d3d2d 100644
--- a/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml
@@ -149,6 +149,7 @@
<flag name='set-action'/>
<flag name='virtio-blk.queue-size'/>
<flag name='query-dirty-rate'/>
+ <flag name='memory-backend-file.prealloc-threads'/>
<version>6000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>39100242</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml
index 0d6763e9a3..99bbb6e237 100644
--- a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml
@@ -236,6 +236,7 @@
<flag name='piix4.acpi-root-pci-hotplug'/>
<flag name='query-dirty-rate'/>
<flag name='sev-inject-launch-secret'/>
+ <flag name='memory-backend-file.prealloc-threads'/>
<version>6000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100242</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml
index 228f397c67..ff0715e605 100644
--- a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml
@@ -240,6 +240,7 @@
<flag name='query-dirty-rate'/>
<flag name='rbd-encryption'/>
<flag name='sev-inject-launch-secret'/>
+ <flag name='memory-backend-file.prealloc-threads'/>
<version>6001000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100243</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml
index 6bf9933bc5..dd6f0e6919 100644
--- a/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml
+++ b/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml
@@ -203,6 +203,7 @@
<flag name='memory-backend-file.reserve'/>
<flag name='query-dirty-rate'/>
<flag name='rbd-encryption'/>
+ <flag name='memory-backend-file.prealloc-threads'/>
<version>6001050</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>61700244</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml
index 06cd7fb396..2646cdf88f 100644
--- a/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml
+++ b/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml
@@ -199,6 +199,7 @@
<flag name='piix4.acpi-root-pci-hotplug'/>
<flag name='query-dirty-rate'/>
<flag name='rbd-encryption'/>
+ <flag name='memory-backend-file.prealloc-threads'/>
<version>6001050</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>42900244</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml
index 75aaeed03c..f25ec1b84a 100644
--- a/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml
@@ -241,6 +241,7 @@
<flag name='rbd-encryption'/>
<flag name='sev-guest-kernel-hashes'/>
<flag name='sev-inject-launch-secret'/>
+ <flag name='memory-backend-file.prealloc-threads'/>
<version>6002000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100244</microcodeVersion>
--
2.35.1

View File

@ -0,0 +1,663 @@
From e4e8b74f2cf090c8b29efcd3ceac4e4c4d07b929 Mon Sep 17 00:00:00 2001
Message-Id: <e4e8b74f2cf090c8b29efcd3ceac4e4c4d07b929@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Thu, 27 Jan 2022 11:13:53 +0100
Subject: [PATCH] qemu_command: Generate memory only after controllers
Currently, memory device (def->mems) part of cmd line is
generated before any controller. In majority of cases it doesn't
matter because neither of memory devices live on a bus that's
created by an exposed controller (e.g. there's no DIMM
controller, at least not exposed). Except for virtio-mem and
virtio-pmem, which do have a PCI address. And if it so happens
that the device goes onto non-default bus (pci.0) starting such
guest fails, because the controller that creates the desired bus
wasn't processed yet. QEMU processes arguments in order.
For instance, if virtio-mem has address with bus='0x01' QEMU
refuses to start with the following message:
Bus 'pci.1' not found
Similarly for virtio-pmem. I've successfully tested migration and
changing the order does not affect migration stream.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2047271
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
(cherry picked from commit af23241cfed712f69450e82135d7c7b4899736de)
Conflicts:
tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args:
tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args:
tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args:
tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args:
tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args:
tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args:
tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-latest.args:
tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args:
tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args:
tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.x86_64-latest.args:
These happened because downstream we don't use JSON for -device,
but upstream we do (as of 1a691fe1c84090da80a652c4c80ac00a6134a69b).
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2050697
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_command.c | 6 +++---
tests/qemuxml2argvdata/hugepages-memaccess.args | 4 ++--
tests/qemuxml2argvdata/hugepages-memaccess2.args | 4 ++--
tests/qemuxml2argvdata/hugepages-numa-default-dimm.args | 4 ++--
.../qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args | 4 ++--
.../qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args | 4 ++--
tests/qemuxml2argvdata/memory-hotplug-dimm-addr.args | 8 ++++----
tests/qemuxml2argvdata/memory-hotplug-dimm.args | 8 ++++----
.../memory-hotplug-nvdimm-access.x86_64-latest.args | 4 ++--
.../memory-hotplug-nvdimm-align.x86_64-5.2.0.args | 4 ++--
.../memory-hotplug-nvdimm-align.x86_64-latest.args | 4 ++--
.../memory-hotplug-nvdimm-label.x86_64-5.2.0.args | 4 ++--
.../memory-hotplug-nvdimm-label.x86_64-latest.args | 4 ++--
.../memory-hotplug-nvdimm-pmem.x86_64-5.2.0.args | 4 ++--
.../memory-hotplug-nvdimm-pmem.x86_64-latest.args | 4 ++--
.../memory-hotplug-nvdimm-ppc64-abi-update.args | 4 ++--
tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.args | 4 ++--
.../memory-hotplug-nvdimm-readonly.x86_64-5.2.0.args | 4 ++--
.../memory-hotplug-nvdimm-readonly.x86_64-latest.args | 4 ++--
.../memory-hotplug-nvdimm.x86_64-latest.args | 4 ++--
.../memory-hotplug-ppc64-nonuma-abi-update.args | 8 ++++----
tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma.args | 8 ++++----
.../memory-hotplug-virtio-mem.x86_64-latest.args | 8 ++++----
.../memory-hotplug-virtio-pmem.x86_64-5.2.0.args | 4 ++--
.../memory-hotplug-virtio-pmem.x86_64-latest.args | 4 ++--
tests/qemuxml2argvdata/pages-dimm-discard.args | 8 ++++----
26 files changed, 65 insertions(+), 65 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 6b4647a711..2acdcca2ff 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -10565,9 +10565,6 @@ qemuBuildCommandLine(virQEMUDriver *driver,
qemuBuildNumaCommandLine(cfg, def, cmd, priv) < 0)
return NULL;
- if (qemuBuildMemoryDeviceCommandLine(cmd, cfg, def, priv) < 0)
- return NULL;
-
virUUIDFormat(def->uuid, uuid);
virCommandAddArgList(cmd, "-uuid", uuid, NULL);
@@ -10617,6 +10614,9 @@ qemuBuildCommandLine(virQEMUDriver *driver,
if (qemuBuildControllersCommandLine(cmd, def, qemuCaps) < 0)
return NULL;
+ if (qemuBuildMemoryDeviceCommandLine(cmd, cfg, def, priv) < 0)
+ return NULL;
+
if (qemuBuildHubCommandLine(cmd, def, qemuCaps) < 0)
return NULL;
diff --git a/tests/qemuxml2argvdata/hugepages-memaccess.args b/tests/qemuxml2argvdata/hugepages-memaccess.args
index b89f791697..a369c7f6da 100644
--- a/tests/qemuxml2argvdata/hugepages-memaccess.args
+++ b/tests/qemuxml2argvdata/hugepages-memaccess.args
@@ -24,8 +24,6 @@ QEMU_AUDIO_DRV=none \
-numa node,nodeid=2,cpus=2,memdev=ram-node2 \
-object memory-backend-file,id=ram-node3,mem-path=/dev/hugepages1G/libvirt/qemu/-1-QEMUGuest1,share=off,prealloc=on,size=1073741824,host-nodes=3,policy=bind \
-numa node,nodeid=3,cpus=3,memdev=ram-node3 \
--object memory-backend-file,id=memdimm0,mem-path=/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1,share=on,prealloc=on,size=536870912,host-nodes=0-3,policy=bind \
--device pc-dimm,node=1,memdev=memdimm0,id=dimm0,slot=0,addr=4294967296 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -37,6 +35,8 @@ QEMU_AUDIO_DRV=none \
-no-acpi \
-boot strict=on \
-usb \
+-object memory-backend-file,id=memdimm0,mem-path=/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1,share=on,prealloc=on,size=536870912,host-nodes=0-3,policy=bind \
+-device pc-dimm,node=1,memdev=memdimm0,id=dimm0,slot=0,addr=4294967296 \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
diff --git a/tests/qemuxml2argvdata/hugepages-memaccess2.args b/tests/qemuxml2argvdata/hugepages-memaccess2.args
index 0c296797e9..434ebdaa62 100644
--- a/tests/qemuxml2argvdata/hugepages-memaccess2.args
+++ b/tests/qemuxml2argvdata/hugepages-memaccess2.args
@@ -24,8 +24,6 @@ QEMU_AUDIO_DRV=none \
-numa node,nodeid=2,cpus=2,memdev=ram-node2 \
-object memory-backend-file,id=ram-node3,mem-path=/var/lib/libvirt/qemu/ram/-1-QEMUGuest1/ram-node3,share=off,size=1073741824,host-nodes=3,policy=bind \
-numa node,nodeid=3,cpus=3,memdev=ram-node3 \
--object memory-backend-file,id=memdimm0,mem-path=/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1,share=on,prealloc=on,size=536870912,host-nodes=0-3,policy=bind \
--device pc-dimm,node=1,memdev=memdimm0,id=dimm0,slot=0,addr=4294967296 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -37,6 +35,8 @@ QEMU_AUDIO_DRV=none \
-no-acpi \
-boot strict=on \
-usb \
+-object memory-backend-file,id=memdimm0,mem-path=/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1,share=on,prealloc=on,size=536870912,host-nodes=0-3,policy=bind \
+-device pc-dimm,node=1,memdev=memdimm0,id=dimm0,slot=0,addr=4294967296 \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
diff --git a/tests/qemuxml2argvdata/hugepages-numa-default-dimm.args b/tests/qemuxml2argvdata/hugepages-numa-default-dimm.args
index f560cabf8e..57bb70346d 100644
--- a/tests/qemuxml2argvdata/hugepages-numa-default-dimm.args
+++ b/tests/qemuxml2argvdata/hugepages-numa-default-dimm.args
@@ -19,8 +19,6 @@ QEMU_AUDIO_DRV=none \
-mem-prealloc \
-mem-path /dev/hugepages2M/libvirt/qemu/-1-fedora \
-numa node,nodeid=0,cpus=0-1,mem=1024 \
--object memory-backend-file,id=memdimm0,mem-path=/dev/hugepages1G/libvirt/qemu/-1-fedora,size=1073741824,host-nodes=1-3,policy=bind \
--device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0 \
-uuid 63840878-0deb-4095-97e6-fc444d9bc9fa \
-display none \
-no-user-config \
@@ -32,4 +30,6 @@ QEMU_AUDIO_DRV=none \
-no-acpi \
-boot strict=on \
-usb \
+-object memory-backend-file,id=memdimm0,mem-path=/dev/hugepages1G/libvirt/qemu/-1-fedora,size=1073741824,host-nodes=1-3,policy=bind \
+-device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0 \
-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args b/tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args
index 8b5665f86e..7d9dcfb4df 100644
--- a/tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args
@@ -18,8 +18,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object '{"qom-type":"memory-backend-file","id":"ram-node0","mem-path":"/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1","share":true,"prealloc":true,"size":1073741824}' \
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
--object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","share":true,"prealloc":true,"size":536870912}' \
--device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -31,6 +29,8 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","share":true,"prealloc":true,"size":536870912}' \
+-device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-audiodev '{"id":"audio1","driver":"none"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args b/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
index 8a40e2d79c..04a320d469 100644
--- a/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
@@ -18,8 +18,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-instance-00000092/.config \
-smp 8,sockets=1,dies=1,cores=8,threads=1 \
-object '{"qom-type":"memory-backend-memfd","id":"ram-node0","hugetlb":true,"hugetlbsize":2097152,"share":true,"prealloc":true,"size":15032385536,"host-nodes":[3],"policy":"preferred"}' \
-numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \
--object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","share":true,"prealloc":true,"size":536870912,"host-nodes":[3],"policy":"preferred"}' \
--device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-uuid 126f2720-6f8e-45ab-a886-ec9277079a67 \
-display none \
-no-user-config \
@@ -31,6 +29,8 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-instance-00000092/.config \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","share":true,"prealloc":true,"size":536870912,"host-nodes":[3],"policy":"preferred"}' \
+-device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-audiodev '{"id":"audio1","driver":"none"}' \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-dimm-addr.args b/tests/qemuxml2argvdata/memory-hotplug-dimm-addr.args
index 907072d55d..b36117f1e8 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-dimm-addr.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-dimm-addr.args
@@ -17,10 +17,6 @@ QEMU_AUDIO_DRV=none \
-realtime mlock=off \
-smp 2,sockets=2,cores=1,threads=1 \
-numa node,nodeid=0,cpus=0-1,mem=214 \
--object memory-backend-file,id=memdimm0,mem-path=/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1,prealloc=on,size=536870912,host-nodes=1-3,policy=bind \
--device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0,addr=4294967296 \
--object memory-backend-ram,id=memdimm2,size=536870912 \
--device pc-dimm,node=0,memdev=memdimm2,id=dimm2,slot=2 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -32,6 +28,10 @@ QEMU_AUDIO_DRV=none \
-no-acpi \
-boot strict=on \
-usb \
+-object memory-backend-file,id=memdimm0,mem-path=/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1,prealloc=on,size=536870912,host-nodes=1-3,policy=bind \
+-device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0,addr=4294967296 \
+-object memory-backend-ram,id=memdimm2,size=536870912 \
+-device pc-dimm,node=0,memdev=memdimm2,id=dimm2,slot=2 \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-dimm.args b/tests/qemuxml2argvdata/memory-hotplug-dimm.args
index 5d87f4a3ef..72c2803c5e 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-dimm.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-dimm.args
@@ -17,10 +17,6 @@ QEMU_AUDIO_DRV=none \
-realtime mlock=off \
-smp 2,sockets=2,cores=1,threads=1 \
-numa node,nodeid=0,cpus=0-1,mem=214 \
--object memory-backend-ram,id=memdimm0,size=536870912 \
--device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0 \
--object memory-backend-file,id=memdimm1,mem-path=/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1,prealloc=on,size=536870912,host-nodes=1-3,policy=bind \
--device pc-dimm,node=0,memdev=memdimm1,id=dimm1,slot=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -32,6 +28,10 @@ QEMU_AUDIO_DRV=none \
-no-acpi \
-boot strict=on \
-usb \
+-object memory-backend-ram,id=memdimm0,size=536870912 \
+-device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0 \
+-object memory-backend-file,id=memdimm1,mem-path=/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1,prealloc=on,size=536870912,host-nodes=1-3,policy=bind \
+-device pc-dimm,node=0,memdev=memdimm1,id=dimm1,slot=1 \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args
index 3664150c51..94aeadabce 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args
@@ -18,8 +18,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":224395264}' \
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
--object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","share":false,"prealloc":true,"size":536870912}' \
--device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -31,6 +29,8 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","share":false,"prealloc":true,"size":536870912}' \
+-device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-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 ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-5.2.0.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-5.2.0.args
index 6c28c86004..0b29a6fded 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-5.2.0.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-5.2.0.args
@@ -18,8 +18,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object memory-backend-ram,id=ram-node0,size=224395264 \
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
--object memory-backend-file,id=memnvdimm0,mem-path=/tmp/nvdimm,share=off,prealloc=on,size=536870912,align=2097152 \
--device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -31,6 +29,8 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-object memory-backend-file,id=memnvdimm0,mem-path=/tmp/nvdimm,share=off,prealloc=on,size=536870912,align=2097152 \
+-device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-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 ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args
index aa77849079..5045cc8318 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args
@@ -18,8 +18,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":224395264}' \
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
--object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","share":false,"prealloc":true,"size":536870912,"align":2097152}' \
--device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -31,6 +29,8 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","share":false,"prealloc":true,"size":536870912,"align":2097152}' \
+-device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-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 ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-5.2.0.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-5.2.0.args
index c45b401af5..7c67161b78 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-5.2.0.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-5.2.0.args
@@ -18,8 +18,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object memory-backend-ram,id=ram-node0,size=224395264 \
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
--object memory-backend-file,id=memnvdimm0,mem-path=/tmp/nvdimm,share=off,prealloc=on,size=536870912 \
--device nvdimm,node=0,label-size=131072,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -31,6 +29,8 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-object memory-backend-file,id=memnvdimm0,mem-path=/tmp/nvdimm,share=off,prealloc=on,size=536870912 \
+-device nvdimm,node=0,label-size=131072,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-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 ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args
index 07863ba87c..9466877699 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args
@@ -18,8 +18,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":224395264}' \
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
--object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","share":false,"prealloc":true,"size":536870912}' \
--device nvdimm,node=0,label-size=131072,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -31,6 +29,8 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","share":false,"prealloc":true,"size":536870912}' \
+-device nvdimm,node=0,label-size=131072,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-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 ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-5.2.0.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-5.2.0.args
index 3f35d4dca2..c4dae0cfd1 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-5.2.0.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-5.2.0.args
@@ -18,8 +18,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object memory-backend-ram,id=ram-node0,size=224395264 \
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
--object memory-backend-file,id=memnvdimm0,mem-path=/tmp/nvdimm,share=off,size=536870912,pmem=on \
--device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -31,6 +29,8 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-object memory-backend-file,id=memnvdimm0,mem-path=/tmp/nvdimm,share=off,size=536870912,pmem=on \
+-device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-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 ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args
index 4ed86feb01..9324535ac3 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args
@@ -18,8 +18,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":224395264}' \
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
--object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","share":false,"size":536870912,"pmem":true}' \
--device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -31,6 +29,8 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","share":false,"size":536870912,"pmem":true}' \
+-device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-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 ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64-abi-update.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64-abi-update.args
index ebdb0429d0..55b16c9dc2 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64-abi-update.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64-abi-update.args
@@ -17,8 +17,6 @@ QEMU_AUDIO_DRV=none \
-realtime mlock=off \
-smp 2,sockets=2,cores=1,threads=1 \
-numa node,nodeid=0,cpus=0-1,mem=1024 \
--object memory-backend-file,id=memnvdimm0,mem-path=/tmp/nvdimm,prealloc=on,size=537001984 \
--device nvdimm,node=0,label-size=131072,uuid=49545eb3-75e1-2d0a-acdd-f0294406c99e,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -28,4 +26,6 @@ QEMU_AUDIO_DRV=none \
-rtc base=utc \
-no-shutdown \
-boot strict=on \
+-object memory-backend-file,id=memnvdimm0,mem-path=/tmp/nvdimm,prealloc=on,size=537001984 \
+-device nvdimm,node=0,label-size=131072,uuid=49545eb3-75e1-2d0a-acdd-f0294406c99e,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.args
index ebdb0429d0..55b16c9dc2 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.args
@@ -17,8 +17,6 @@ QEMU_AUDIO_DRV=none \
-realtime mlock=off \
-smp 2,sockets=2,cores=1,threads=1 \
-numa node,nodeid=0,cpus=0-1,mem=1024 \
--object memory-backend-file,id=memnvdimm0,mem-path=/tmp/nvdimm,prealloc=on,size=537001984 \
--device nvdimm,node=0,label-size=131072,uuid=49545eb3-75e1-2d0a-acdd-f0294406c99e,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -28,4 +26,6 @@ QEMU_AUDIO_DRV=none \
-rtc base=utc \
-no-shutdown \
-boot strict=on \
+-object memory-backend-file,id=memnvdimm0,mem-path=/tmp/nvdimm,prealloc=on,size=537001984 \
+-device nvdimm,node=0,label-size=131072,uuid=49545eb3-75e1-2d0a-acdd-f0294406c99e,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-5.2.0.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-5.2.0.args
index bca2f286ba..b1873c100f 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-5.2.0.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-5.2.0.args
@@ -18,8 +18,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object memory-backend-ram,id=ram-node0,size=224395264 \
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
--object memory-backend-file,id=memnvdimm0,mem-path=/tmp/nvdimm,share=off,prealloc=on,size=536870912 \
--device nvdimm,node=0,unarmed=on,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -31,6 +29,8 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-object memory-backend-file,id=memnvdimm0,mem-path=/tmp/nvdimm,share=off,prealloc=on,size=536870912 \
+-device nvdimm,node=0,unarmed=on,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-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 ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-latest.args
index 8be7f35cec..4f11d22e00 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-latest.args
@@ -18,8 +18,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":224395264}' \
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
--object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","share":false,"prealloc":true,"size":536870912}' \
--device nvdimm,node=0,unarmed=on,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -31,6 +29,8 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","share":false,"prealloc":true,"size":536870912}' \
+-device nvdimm,node=0,unarmed=on,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-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 ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args
index 307698749e..434a0f91cf 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args
@@ -18,8 +18,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":1073741824}' \
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
--object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","prealloc":true,"size":536870912}' \
--device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -31,6 +29,8 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","prealloc":true,"size":536870912}' \
+-device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-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 ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma-abi-update.args b/tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma-abi-update.args
index 5380c9e805..e8a6451841 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma-abi-update.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma-abi-update.args
@@ -16,10 +16,6 @@ QEMU_AUDIO_DRV=none \
-m size=1048576k,slots=16,maxmem=4194304k \
-realtime mlock=off \
-smp 1,sockets=1,cores=1,threads=1 \
--object memory-backend-ram,id=memdimm0,size=536870912 \
--device pc-dimm,memdev=memdimm0,id=dimm0,slot=0 \
--object memory-backend-ram,id=memdimm1,size=536870912 \
--device pc-dimm,memdev=memdimm1,id=dimm1,slot=1 \
-uuid 49545eb3-75e1-2d0a-acdd-f0294406c99e \
-display none \
-no-user-config \
@@ -29,4 +25,8 @@ QEMU_AUDIO_DRV=none \
-rtc base=utc \
-no-shutdown \
-boot strict=on \
+-object memory-backend-ram,id=memdimm0,size=536870912 \
+-device pc-dimm,memdev=memdimm0,id=dimm0,slot=0 \
+-object memory-backend-ram,id=memdimm1,size=536870912 \
+-device pc-dimm,memdev=memdimm1,id=dimm1,slot=1 \
-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma.args b/tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma.args
index acff36eb78..181409cde0 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma.args
@@ -16,10 +16,6 @@ QEMU_AUDIO_DRV=none \
-m size=1310720k,slots=16,maxmem=4194304k \
-realtime mlock=off \
-smp 1,sockets=1,cores=1,threads=1 \
--object memory-backend-ram,id=memdimm0,size=536870912 \
--device pc-dimm,memdev=memdimm0,id=dimm0,slot=0 \
--object memory-backend-ram,id=memdimm1,size=536870912 \
--device pc-dimm,memdev=memdimm1,id=dimm1,slot=1 \
-uuid 49545eb3-75e1-2d0a-acdd-f0294406c99e \
-display none \
-no-user-config \
@@ -29,4 +25,8 @@ QEMU_AUDIO_DRV=none \
-rtc base=utc \
-no-shutdown \
-boot strict=on \
+-object memory-backend-ram,id=memdimm0,size=536870912 \
+-device pc-dimm,memdev=memdimm0,id=dimm0,slot=0 \
+-object memory-backend-ram,id=memdimm1,size=536870912 \
+-device pc-dimm,memdev=memdimm1,id=dimm1,slot=1 \
-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
index 8747b249da..30b635d365 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
@@ -18,10 +18,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":2145386496}' \
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
--object '{"qom-type":"memory-backend-ram","id":"memvirtiomem0","reserve":false,"size":1073741824}' \
--device virtio-mem-pci,node=0,block-size=2097152,requested-size=536870912,memdev=memvirtiomem0,id=virtiomem0,bus=pci.0,addr=0x2 \
--object '{"qom-type":"memory-backend-file","id":"memvirtiomem1","mem-path":"/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1","reserve":false,"size":2147483648,"host-nodes":[1,2,3],"policy":"bind"}' \
--device virtio-mem-pci,node=0,block-size=2097152,requested-size=1073741824,memdev=memvirtiomem1,id=virtiomem1,bus=pci.0,addr=0x3 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -33,6 +29,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-object '{"qom-type":"memory-backend-ram","id":"memvirtiomem0","reserve":false,"size":1073741824}' \
+-device virtio-mem-pci,node=0,block-size=2097152,requested-size=536870912,memdev=memvirtiomem0,id=virtiomem0,bus=pci.0,addr=0x2 \
+-object '{"qom-type":"memory-backend-file","id":"memvirtiomem1","mem-path":"/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1","reserve":false,"size":2147483648,"host-nodes":[1,2,3],"policy":"bind"}' \
+-device virtio-mem-pci,node=0,block-size=2097152,requested-size=1073741824,memdev=memvirtiomem1,id=virtiomem1,bus=pci.0,addr=0x3 \
-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 ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.x86_64-5.2.0.args b/tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.x86_64-5.2.0.args
index 17fd98fb88..8fa678c209 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.x86_64-5.2.0.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.x86_64-5.2.0.args
@@ -18,8 +18,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object memory-backend-ram,id=ram-node0,size=2145386496 \
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
--object memory-backend-file,id=memvirtiopmem0,mem-path=/tmp/virtio_pmem,share=on,size=536870912 \
--device virtio-pmem-pci,memdev=memvirtiopmem0,id=virtiopmem0,bus=pci.0,addr=0x5 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -31,6 +29,8 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-object memory-backend-file,id=memvirtiopmem0,mem-path=/tmp/virtio_pmem,share=on,size=536870912 \
+-device virtio-pmem-pci,memdev=memvirtiopmem0,id=virtiopmem0,bus=pci.0,addr=0x5 \
-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 ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.x86_64-latest.args
index e5a91b6d33..95ff490cef 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.x86_64-latest.args
@@ -18,8 +18,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":2145386496}' \
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
--object '{"qom-type":"memory-backend-file","id":"memvirtiopmem0","mem-path":"/tmp/virtio_pmem","share":true,"size":536870912}' \
--device virtio-pmem-pci,memdev=memvirtiopmem0,id=virtiopmem0,bus=pci.0,addr=0x5 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@@ -31,6 +29,8 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-object '{"qom-type":"memory-backend-file","id":"memvirtiopmem0","mem-path":"/tmp/virtio_pmem","share":true,"size":536870912}' \
+-device virtio-pmem-pci,memdev=memvirtiopmem0,id=virtiopmem0,bus=pci.0,addr=0x5 \
-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 ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
diff --git a/tests/qemuxml2argvdata/pages-dimm-discard.args b/tests/qemuxml2argvdata/pages-dimm-discard.args
index 2ebe9c1350..e63c908549 100644
--- a/tests/qemuxml2argvdata/pages-dimm-discard.args
+++ b/tests/qemuxml2argvdata/pages-dimm-discard.args
@@ -17,10 +17,6 @@ QEMU_AUDIO_DRV=none \
-realtime mlock=off \
-smp 2,sockets=2,cores=1,threads=1 \
-numa node,nodeid=0,cpus=0-1,mem=1024 \
--object memory-backend-file,id=memdimm0,mem-path=/dev/hugepages1G/libvirt/qemu/-1-fedora,prealloc=on,size=1073741824,host-nodes=1-3,policy=bind \
--device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0 \
--object memory-backend-file,id=memdimm1,mem-path=/var/lib/libvirt/qemu/ram/-1-fedora/dimm1,discard-data=on,share=off,size=536870912 \
--device pc-dimm,node=0,memdev=memdimm1,id=dimm1,slot=1 \
-uuid 63840878-0deb-4095-97e6-fc444d9bc9fa \
-display none \
-no-user-config \
@@ -32,4 +28,8 @@ QEMU_AUDIO_DRV=none \
-no-acpi \
-boot strict=on \
-usb \
+-object memory-backend-file,id=memdimm0,mem-path=/dev/hugepages1G/libvirt/qemu/-1-fedora,prealloc=on,size=1073741824,host-nodes=1-3,policy=bind \
+-device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0 \
+-object memory-backend-file,id=memdimm1,mem-path=/var/lib/libvirt/qemu/ram/-1-fedora/dimm1,discard-data=on,share=off,size=536870912 \
+-device pc-dimm,node=0,memdev=memdimm1,id=dimm1,slot=1 \
-msg timestamp=on
--
2.35.1

View File

@ -0,0 +1,66 @@
From e52b12a986de8ac469b98135b2c1d2a8a63b9052 Mon Sep 17 00:00:00 2001
Message-Id: <e52b12a986de8ac469b98135b2c1d2a8a63b9052@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Mon, 21 Mar 2022 17:10:15 +0100
Subject: [PATCH] qemu_command: Generate prealloc-threads property
Let's generate prealloc-threads property onto the cmd line if
domain configuration requests so.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
(cherry picked from commit b8d6ecc70c8a8e9c90bab48b6829b42d8b77c748)
Conflicts:
tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args:
Upstream has moved some cmd line arguments
(v8.0.0-260-gaf23241cfe) but that is not backported.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2067126
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_command.c | 5 ++++-
tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args | 4 ++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 2acdcca2ff..d23af97e0c 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3856,7 +3856,10 @@ qemuBuildMemoryBackendProps(virJSONValue **backendProps,
return -1;
} else {
if (!priv->memPrealloc &&
- virJSONValueObjectAdd(&props, "B:prealloc", prealloc, NULL) < 0)
+ virJSONValueObjectAdd(&props,
+ "B:prealloc", prealloc,
+ "p:prealloc-threads", def->mem.allocation_threads,
+ NULL) < 0)
return -1;
}
diff --git a/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args b/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
index 04a320d469..9b2e6086c3 100644
--- a/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
@@ -16,7 +16,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-instance-00000092/.config \
-m size=14680064k,slots=16,maxmem=1099511627776k \
-overcommit mem-lock=off \
-smp 8,sockets=1,dies=1,cores=8,threads=1 \
--object '{"qom-type":"memory-backend-memfd","id":"ram-node0","hugetlb":true,"hugetlbsize":2097152,"share":true,"prealloc":true,"size":15032385536,"host-nodes":[3],"policy":"preferred"}' \
+-object '{"qom-type":"memory-backend-memfd","id":"ram-node0","hugetlb":true,"hugetlbsize":2097152,"share":true,"prealloc":true,"prealloc-threads":8,"size":15032385536,"host-nodes":[3],"policy":"preferred"}' \
-numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \
-uuid 126f2720-6f8e-45ab-a886-ec9277079a67 \
-display none \
@@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-instance-00000092/.config \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
--object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","share":true,"prealloc":true,"size":536870912,"host-nodes":[3],"policy":"preferred"}' \
+-object '{"qom-type":"memory-backend-file","id":"memnvdimm0","mem-path":"/tmp/nvdimm","share":true,"prealloc":true,"prealloc-threads":8,"size":536870912,"host-nodes":[3],"policy":"preferred"}' \
-device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-audiodev '{"id":"audio1","driver":"none"}' \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
--
2.35.1

View File

@ -0,0 +1,39 @@
From 088ba382d7a099ddbebe37e5486ce648e24266db Mon Sep 17 00:00:00 2001
Message-Id: <088ba382d7a099ddbebe37e5486ce648e24266db@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Mon, 21 Mar 2022 17:09:40 +0100
Subject: [PATCH] qemu_validate: Validate prealloc threads against qemuCpas
Only fairly new QEMUs are capable of user provided number of
preallocation threads. Validate this assumption.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
(cherry picked from commit 75a4e0165ef199809974e97b507d3953e1de01d1)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2067126
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_validate.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 3a69733f81..7bc14293d6 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -739,6 +739,13 @@ qemuValidateDomainDefMemory(const virDomainDef *def,
return -1;
}
+ if (mem->allocation_threads > 0 &&
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_MEMORY_BACKEND_PREALLOC_THREADS)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("preallocation threads are unsupported with this QEMU"));
+ return -1;
+ }
+
if (mem->source == VIR_DOMAIN_MEMORY_SOURCE_ANONYMOUS) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("hugepages are not allowed with anonymous "
--
2.35.1

View File

@ -210,7 +210,7 @@
Summary: Library providing a simple virtualization API
Name: libvirt
Version: 8.0.0
Release: 2%{?dist}%{?extra_release}
Release: 6%{?dist}%{?extra_release}
License: LGPLv2+
URL: https://libvirt.org/
@ -232,6 +232,16 @@ Patch9: libvirt-RHEL-virutil-Accept-non-block-devices-in-virGetDeviceID.patch
Patch10: libvirt-RHEL-Enable-usage-of-x-blockdev-reopen.patch
Patch11: libvirt-Revert-report-error-when-virProcessGetStatInfo-is-unable-to-parse-data.patch
Patch12: libvirt-qemu-fix-inactive-snapshot-revert.patch
Patch13: libvirt-qemuDomainSetupDisk-Initialize-targetPaths.patch
Patch14: libvirt-RHEL-Remove-glib-2.64.0-workaround-for-GSource-race.patch
Patch15: libvirt-qemu_command-Generate-memory-only-after-controllers.patch
Patch16: libvirt-qemu-Validate-domain-definition-even-on-migration.patch
Patch17: libvirt-node_device-Rework-udevKludgeStorageType.patch
Patch18: libvirt-node_device-Treat-NVMe-disks-as-regular-disks.patch
Patch19: libvirt-conf-Introduce-memory-allocation-threads.patch
Patch20: libvirt-qemu_capabilities-Detect-memory-backend-.prealloc-threads-property.patch
Patch21: libvirt-qemu_validate-Validate-prealloc-threads-against-qemuCpas.patch
Patch22: libvirt-qemu_command-Generate-prealloc-threads-property.patch
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-daemon-config-network = %{version}-%{release}
@ -2105,6 +2115,24 @@ exit 0
%changelog
* Wed Apr 27 2022 Jiri Denemark <jdenemar@redhat.com> - 8.0.0-6
- conf: Introduce memory allocation threads (rhbz#2067126)
- qemu_capabilities: Detect memory-backend-*.prealloc-threads property (rhbz#2067126)
- qemu_validate: Validate prealloc threads against qemuCpas (rhbz#2067126)
- qemu_command: Generate prealloc-threads property (rhbz#2067126)
* Fri Feb 25 2022 Jiri Denemark <jdenemar@redhat.com> - 8.0.0-5
- node_device: Rework udevKludgeStorageType() (rhbz#2056673)
- node_device: Treat NVMe disks as regular disks (rhbz#2056673)
* Thu Feb 10 2022 Jiri Denemark <jdenemar@redhat.com> - 8.0.0-4
- qemu_command: Generate memory only after controllers (rhbz#2050697)
- qemu: Validate domain definition even on migration (rhbz#2050702)
* Wed Feb 2 2022 Jiri Denemark <jdenemar@redhat.com> - 8.0.0-3
- qemuDomainSetupDisk: Initialize 'targetPaths' (rhbz#2046172)
- RHEL: Remove <glib-2.64.0 workaround for GSource race (rhbz#2045879)
* Wed Jan 26 2022 Jiri Denemark <jdenemar@redhat.com> - 8.0.0-2
- Revert "report error when virProcessGetStatInfo() is unable to parse data" (rhbz#2041610)
- qemu: fix inactive snapshot revert (rhbz#2043584)