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