render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
d76c62
From 2527410246c5d9f0642087fbd894fdba8d8fa906 Mon Sep 17 00:00:00 2001
d76c62
Message-Id: <2527410246c5d9f0642087fbd894fdba8d8fa906@dist-git>
d76c62
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
d76c62
Date: Mon, 3 Feb 2020 18:07:24 +0000
d76c62
Subject: [PATCH] qemu: add support for specifying CPU "dies" topology
d76c62
 parameter
d76c62
MIME-Version: 1.0
d76c62
Content-Type: text/plain; charset=UTF-8
d76c62
Content-Transfer-Encoding: 8bit
d76c62
d76c62
QEMU since 4.1.0 supports the "dies" parameter for -smp
d76c62
d76c62
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
d76c62
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
d76c62
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
d76c62
(cherry picked from commit 4cf8dd0c57330e9141333a1b9f4e318e3c83a289)
d76c62
d76c62
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1785207
d76c62
Message-Id: <20200203180726.2203691-4-berrange@redhat.com>
d76c62
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
d76c62
---
d76c62
 src/qemu/qemu_capabilities.c                  |  2 ++
d76c62
 src/qemu/qemu_capabilities.h                  |  1 +
d76c62
 src/qemu/qemu_command.c                       |  9 +++--
d76c62
 .../caps_4.1.0.x86_64.xml                     |  1 +
d76c62
 .../caps_4.2.0.aarch64.xml                    |  1 +
d76c62
 .../qemucapabilitiesdata/caps_4.2.0.ppc64.xml |  1 +
d76c62
 .../qemucapabilitiesdata/caps_4.2.0.s390x.xml |  1 +
d76c62
 .../caps_4.2.0.x86_64.xml                     |  1 +
d76c62
 .../hugepages-nvdimm.x86_64-latest.args       |  2 +-
d76c62
 ...memory-default-hugepage.x86_64-latest.args |  2 +-
d76c62
 .../memfd-memory-numa.x86_64-latest.args      |  2 +-
d76c62
 ...y-hotplug-nvdimm-access.x86_64-latest.args |  2 +-
d76c62
 ...ry-hotplug-nvdimm-align.x86_64-latest.args |  2 +-
d76c62
 ...ry-hotplug-nvdimm-label.x86_64-latest.args |  2 +-
d76c62
 ...ory-hotplug-nvdimm-pmem.x86_64-latest.args |  2 +-
d76c62
 ...hotplug-nvdimm-readonly.x86_64-latest.args |  2 +-
d76c62
 .../memory-hotplug-nvdimm.x86_64-latest.args  |  2 +-
d76c62
 tests/qemuxml2argvdata/smp-dies.args          | 29 ++++++++++++++++
d76c62
 tests/qemuxml2argvdata/smp-dies.xml           | 33 +++++++++++++++++++
d76c62
 tests/qemuxml2argvtest.c                      |  1 +
d76c62
 20 files changed, 86 insertions(+), 12 deletions(-)
d76c62
 create mode 100644 tests/qemuxml2argvdata/smp-dies.args
d76c62
 create mode 100644 tests/qemuxml2argvdata/smp-dies.xml
d76c62
d76c62
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
d76c62
index edefb70309..893fc5a1bb 100644
d76c62
--- a/src/qemu/qemu_capabilities.c
d76c62
+++ b/src/qemu/qemu_capabilities.c
d76c62
@@ -553,6 +553,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
d76c62
               "blockdev-file-dynamic-auto-read-only",
d76c62
               "savevm-monitor-nodes",
d76c62
               "drive-nvme",
d76c62
+              "smp-dies",
d76c62
     );
d76c62
 
d76c62
 
d76c62
@@ -3097,6 +3098,7 @@ static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = {
d76c62
     { "sandbox", "elevateprivileges", QEMU_CAPS_SECCOMP_BLACKLIST },
d76c62
     { "chardev", "fd", QEMU_CAPS_CHARDEV_FD_PASS },
d76c62
     { "overcommit", NULL, QEMU_CAPS_OVERCOMMIT },
d76c62
+    { "smp-opts", "dies", QEMU_CAPS_SMP_DIES },
d76c62
 };
d76c62
 
d76c62
 static int
d76c62
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
d76c62
index d76c1dbfa9..5ec8901bb3 100644
d76c62
--- a/src/qemu/qemu_capabilities.h
d76c62
+++ b/src/qemu/qemu_capabilities.h
d76c62
@@ -534,6 +534,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
d76c62
     QEMU_CAPS_BLOCK_FILE_AUTO_READONLY_DYNAMIC, /* the auto-read-only property of block backends for files is dynamic */
d76c62
     QEMU_CAPS_SAVEVM_MONITOR_NODES, /* 'savevm' handles monitor-owned nodes properly */
d76c62
     QEMU_CAPS_DRIVE_NVME, /* -drive file.driver=nvme */
d76c62
+    QEMU_CAPS_SMP_DIES, /*  -smp dies= */
d76c62
 
d76c62
     QEMU_CAPS_LAST /* this must always be the last item */
d76c62
 } virQEMUCapsFlags;
d76c62
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
d76c62
index d7e8216092..7a184c229e 100644
d76c62
--- a/src/qemu/qemu_command.c
d76c62
+++ b/src/qemu/qemu_command.c
d76c62
@@ -7105,7 +7105,8 @@ qemuBuildTSEGCommandLine(virCommandPtr cmd,
d76c62
 
d76c62
 static int
d76c62
 qemuBuildSmpCommandLine(virCommandPtr cmd,
d76c62
-                        virDomainDefPtr def)
d76c62
+                        virDomainDefPtr def,
d76c62
+                        virQEMUCapsPtr qemuCaps)
d76c62
 {
d76c62
     g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
d76c62
     unsigned int maxvcpus = virDomainDefGetVcpusMax(def);
d76c62
@@ -7130,12 +7131,14 @@ qemuBuildSmpCommandLine(virCommandPtr cmd,
d76c62
     /* sockets, cores, and threads are either all zero
d76c62
      * or all non-zero, thus checking one of them is enough */
d76c62
     if (def->cpu && def->cpu->sockets) {
d76c62
-        if (def->cpu->dies != 1) {
d76c62
+        if (def->cpu->dies != 1 && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_SMP_DIES)) {
d76c62
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
d76c62
                            _("Only 1 die per socket is supported"));
d76c62
             return -1;
d76c62
         }
d76c62
         virBufferAsprintf(&buf, ",sockets=%u", def->cpu->sockets);
d76c62
+        if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SMP_DIES))
d76c62
+            virBufferAsprintf(&buf, ",dies=%u", def->cpu->dies);
d76c62
         virBufferAsprintf(&buf, ",cores=%u", def->cpu->cores);
d76c62
         virBufferAsprintf(&buf, ",threads=%u", def->cpu->threads);
d76c62
     } else {
d76c62
@@ -9823,7 +9826,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
d76c62
     if (qemuBuildMemCommandLine(cmd, cfg, def, qemuCaps, priv) < 0)
d76c62
         return NULL;
d76c62
 
d76c62
-    if (qemuBuildSmpCommandLine(cmd, def) < 0)
d76c62
+    if (qemuBuildSmpCommandLine(cmd, def, qemuCaps) < 0)
d76c62
         return NULL;
d76c62
 
d76c62
     if (qemuBuildIOThreadCommandLine(cmd, def) < 0)
d76c62
diff --git a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml
d76c62
index a98945de0e..54b797a86a 100644
d76c62
--- a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml
d76c62
+++ b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml
d76c62
@@ -215,6 +215,7 @@
d76c62
   <flag name='ramfb'/>
d76c62
   <flag name='blockdev-file-dynamic-auto-read-only'/>
d76c62
   <flag name='drive-nvme'/>
d76c62
+  <flag name='smp-dies'/>
d76c62
   <version>4001000</version>
d76c62
   <kvmVersion>0</kvmVersion>
d76c62
   <microcodeVersion>43100241</microcodeVersion>
d76c62
diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml
d76c62
index a6469073fd..184bb7ff77 100644
d76c62
--- a/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml
d76c62
+++ b/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml
d76c62
@@ -175,6 +175,7 @@
d76c62
   <flag name='blockdev-file-dynamic-auto-read-only'/>
d76c62
   <flag name='savevm-monitor-nodes'/>
d76c62
   <flag name='drive-nvme'/>
d76c62
+  <flag name='smp-dies'/>
d76c62
   <version>4001050</version>
d76c62
   <kvmVersion>0</kvmVersion>
d76c62
   <microcodeVersion>61700242</microcodeVersion>
d76c62
diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml
d76c62
index ee9fb23640..7c62546d74 100644
d76c62
--- a/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml
d76c62
+++ b/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml
d76c62
@@ -176,6 +176,7 @@
d76c62
   <flag name='machine.pseries.cap-ccf-assist'/>
d76c62
   <flag name='blockdev-file-dynamic-auto-read-only'/>
d76c62
   <flag name='drive-nvme'/>
d76c62
+  <flag name='smp-dies'/>
d76c62
   <version>4001050</version>
d76c62
   <kvmVersion>0</kvmVersion>
d76c62
   <microcodeVersion>42900242</microcodeVersion>
d76c62
diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml b/tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml
d76c62
index fdf5cb4ce9..c8746f05ef 100644
d76c62
--- a/tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml
d76c62
+++ b/tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml
d76c62
@@ -135,6 +135,7 @@
d76c62
   <flag name='query-cpu-model-comparison'/>
d76c62
   <flag name='blockdev-file-dynamic-auto-read-only'/>
d76c62
   <flag name='drive-nvme'/>
d76c62
+  <flag name='smp-dies'/>
d76c62
   <version>4001050</version>
d76c62
   <kvmVersion>0</kvmVersion>
d76c62
   <microcodeVersion>39100242</microcodeVersion>
d76c62
diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml
d76c62
index 4857e2f5a5..afd59a269d 100644
d76c62
--- a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml
d76c62
+++ b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml
d76c62
@@ -218,6 +218,7 @@
d76c62
   <flag name='blockdev-file-dynamic-auto-read-only'/>
d76c62
   <flag name='savevm-monitor-nodes'/>
d76c62
   <flag name='drive-nvme'/>
d76c62
+  <flag name='smp-dies'/>
d76c62
   <version>4002000</version>
d76c62
   <kvmVersion>0</kvmVersion>
d76c62
   <microcodeVersion>43100242</microcodeVersion>
d76c62
diff --git a/tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args b/tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args
d76c62
index 9056e56cb7..0d795dca91 100644
d76c62
--- a/tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args
d76c62
+++ b/tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args
d76c62
@@ -15,7 +15,7 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
d76c62
 -machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \
d76c62
 -m size=1048576k,slots=16,maxmem=1099511627776k \
d76c62
 -overcommit mem-lock=off \
d76c62
--smp 2,sockets=2,cores=1,threads=1 \
d76c62
+-smp 2,sockets=2,dies=1,cores=1,threads=1 \
d76c62
 -object memory-backend-file,id=ram-node0,prealloc=yes,\
d76c62
 mem-path=/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1,share=yes,size=1073741824 \
d76c62
 -numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
d76c62
diff --git a/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-latest.args b/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-latest.args
d76c62
index 998c9f98bd..a655fb1f7c 100644
d76c62
--- a/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-latest.args
d76c62
+++ b/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-latest.args
d76c62
@@ -16,7 +16,7 @@ file=/tmp/lib/domain--1-instance-00000092/master-key.aes \
d76c62
 -m 14336 \
d76c62
 -mem-prealloc \
d76c62
 -overcommit mem-lock=off \
d76c62
--smp 8,sockets=1,cores=8,threads=1 \
d76c62
+-smp 8,sockets=1,dies=1,cores=8,threads=1 \
d76c62
 -object memory-backend-memfd,id=ram-node0,hugetlb=yes,hugetlbsize=2097152,\
d76c62
 share=yes,size=15032385536,host-nodes=3,policy=preferred \
d76c62
 -numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \
d76c62
diff --git a/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args b/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
d76c62
index 998c9f98bd..a655fb1f7c 100644
d76c62
--- a/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
d76c62
+++ b/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
d76c62
@@ -16,7 +16,7 @@ file=/tmp/lib/domain--1-instance-00000092/master-key.aes \
d76c62
 -m 14336 \
d76c62
 -mem-prealloc \
d76c62
 -overcommit mem-lock=off \
d76c62
--smp 8,sockets=1,cores=8,threads=1 \
d76c62
+-smp 8,sockets=1,dies=1,cores=8,threads=1 \
d76c62
 -object memory-backend-memfd,id=ram-node0,hugetlb=yes,hugetlbsize=2097152,\
d76c62
 share=yes,size=15032385536,host-nodes=3,policy=preferred \
d76c62
 -numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \
d76c62
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args
d76c62
index beac9ab22a..c8a6ec5755 100644
d76c62
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args
d76c62
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args
d76c62
@@ -15,7 +15,7 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
d76c62
 -machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \
d76c62
 -m size=219136k,slots=16,maxmem=1099511627776k \
d76c62
 -overcommit mem-lock=off \
d76c62
--smp 2,sockets=2,cores=1,threads=1 \
d76c62
+-smp 2,sockets=2,dies=1,cores=1,threads=1 \
d76c62
 -numa node,nodeid=0,cpus=0-1,mem=214 \
d76c62
 -object memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm,\
d76c62
 share=no,size=536870912 \
d76c62
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args
d76c62
index 3e599098f0..60e9e80039 100644
d76c62
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args
d76c62
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args
d76c62
@@ -15,7 +15,7 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
d76c62
 -machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \
d76c62
 -m size=219136k,slots=16,maxmem=1099511627776k \
d76c62
 -overcommit mem-lock=off \
d76c62
--smp 2,sockets=2,cores=1,threads=1 \
d76c62
+-smp 2,sockets=2,dies=1,cores=1,threads=1 \
d76c62
 -numa node,nodeid=0,cpus=0-1,mem=214 \
d76c62
 -object memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm,\
d76c62
 share=no,size=536870912,align=2097152 \
d76c62
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args
d76c62
index 05a473dbcc..8c5e483cbb 100644
d76c62
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args
d76c62
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args
d76c62
@@ -15,7 +15,7 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
d76c62
 -machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \
d76c62
 -m size=219136k,slots=16,maxmem=1099511627776k \
d76c62
 -overcommit mem-lock=off \
d76c62
--smp 2,sockets=2,cores=1,threads=1 \
d76c62
+-smp 2,sockets=2,dies=1,cores=1,threads=1 \
d76c62
 -numa node,nodeid=0,cpus=0-1,mem=214 \
d76c62
 -object memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm,\
d76c62
 share=no,size=536870912 \
d76c62
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args
d76c62
index c3554ac101..7f77ab9fce 100644
d76c62
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args
d76c62
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args
d76c62
@@ -15,7 +15,7 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
d76c62
 -machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \
d76c62
 -m size=219136k,slots=16,maxmem=1099511627776k \
d76c62
 -overcommit mem-lock=off \
d76c62
--smp 2,sockets=2,cores=1,threads=1 \
d76c62
+-smp 2,sockets=2,dies=1,cores=1,threads=1 \
d76c62
 -numa node,nodeid=0,cpus=0-1,mem=214 \
d76c62
 -object memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm,\
d76c62
 share=no,size=536870912,pmem=on \
d76c62
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-latest.args
d76c62
index e1d3fc57a4..631835a380 100644
d76c62
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-latest.args
d76c62
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-latest.args
d76c62
@@ -15,7 +15,7 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
d76c62
 -machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \
d76c62
 -m size=219136k,slots=16,maxmem=1099511627776k \
d76c62
 -overcommit mem-lock=off \
d76c62
--smp 2,sockets=2,cores=1,threads=1 \
d76c62
+-smp 2,sockets=2,dies=1,cores=1,threads=1 \
d76c62
 -numa node,nodeid=0,cpus=0-1,mem=214 \
d76c62
 -object memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm,\
d76c62
 share=no,size=536870912 \
d76c62
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args
d76c62
index dc6ddd3a0e..48221a5526 100644
d76c62
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args
d76c62
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args
d76c62
@@ -15,7 +15,7 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
d76c62
 -machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \
d76c62
 -m size=1048576k,slots=16,maxmem=1099511627776k \
d76c62
 -overcommit mem-lock=off \
d76c62
--smp 2,sockets=2,cores=1,threads=1 \
d76c62
+-smp 2,sockets=2,dies=1,cores=1,threads=1 \
d76c62
 -numa node,nodeid=0,cpus=0-1,mem=1024 \
d76c62
 -object memory-backend-file,id=memnvdimm0,prealloc=yes,mem-path=/tmp/nvdimm,\
d76c62
 size=536870912 \
d76c62
diff --git a/tests/qemuxml2argvdata/smp-dies.args b/tests/qemuxml2argvdata/smp-dies.args
d76c62
new file mode 100644
d76c62
index 0000000000..632e9d8e34
d76c62
--- /dev/null
d76c62
+++ b/tests/qemuxml2argvdata/smp-dies.args
d76c62
@@ -0,0 +1,29 @@
d76c62
+LC_ALL=C \
d76c62
+PATH=/bin \
d76c62
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
d76c62
+USER=test \
d76c62
+LOGNAME=test \
d76c62
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
d76c62
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
d76c62
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
d76c62
+QEMU_AUDIO_DRV=none \
d76c62
+/usr/bin/qemu-system-i386 \
d76c62
+-name QEMUGuest1 \
d76c62
+-S \
d76c62
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
d76c62
+-m 214 \
d76c62
+-realtime mlock=off \
d76c62
+-smp 1,maxcpus=4,sockets=2,dies=2,cores=1,threads=1 \
d76c62
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
d76c62
+-display none \
d76c62
+-no-user-config \
d76c62
+-nodefaults \
d76c62
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
d76c62
+server,nowait \
d76c62
+-mon chardev=charmonitor,id=monitor,mode=control \
d76c62
+-rtc base=utc \
d76c62
+-no-shutdown \
d76c62
+-no-acpi \
d76c62
+-usb \
d76c62
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
d76c62
+-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1
d76c62
diff --git a/tests/qemuxml2argvdata/smp-dies.xml b/tests/qemuxml2argvdata/smp-dies.xml
d76c62
new file mode 100644
d76c62
index 0000000000..caadaef8b5
d76c62
--- /dev/null
d76c62
+++ b/tests/qemuxml2argvdata/smp-dies.xml
d76c62
@@ -0,0 +1,33 @@
d76c62
+<domain type='qemu'>
d76c62
+  <name>QEMUGuest1</name>
d76c62
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
d76c62
+  <memory unit='KiB'>219136</memory>
d76c62
+  <currentMemory unit='KiB'>219136</currentMemory>
d76c62
+  <vcpu placement='static' current='1'>4</vcpu>
d76c62
+  <os>
d76c62
+    <type arch='i686' machine='pc'>hvm</type>
d76c62
+    <boot dev='hd'/>
d76c62
+  </os>
d76c62
+  <cpu>
d76c62
+    <topology sockets='2' dies='2' cores='1' threads='1'/>
d76c62
+  </cpu>
d76c62
+  <clock offset='utc'/>
d76c62
+  <on_poweroff>destroy</on_poweroff>
d76c62
+  <on_reboot>restart</on_reboot>
d76c62
+  <on_crash>destroy</on_crash>
d76c62
+  <devices>
d76c62
+    <emulator>/usr/bin/qemu-system-i386</emulator>
d76c62
+    <disk type='block' device='disk'>
d76c62
+      <driver name='qemu' type='raw'/>
d76c62
+      <source dev='/dev/HostVG/QEMUGuest1'/>
d76c62
+      <target dev='hda' bus='ide'/>
d76c62
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
d76c62
+    </disk>
d76c62
+    <controller type='usb' index='0'/>
d76c62
+    <controller type='ide' index='0'/>
d76c62
+    <controller type='pci' index='0' model='pci-root'/>
d76c62
+    <input type='mouse' bus='ps2'/>
d76c62
+    <input type='keyboard' bus='ps2'/>
d76c62
+    <memballoon model='none'/>
d76c62
+  </devices>
d76c62
+</domain>
d76c62
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
d76c62
index 58b4deefc6..b923590930 100644
d76c62
--- a/tests/qemuxml2argvtest.c
d76c62
+++ b/tests/qemuxml2argvtest.c
d76c62
@@ -1689,6 +1689,7 @@ mymain(void)
d76c62
     DO_TEST("qemu-ns-alt", NONE);
d76c62
 
d76c62
     DO_TEST("smp", NONE);
d76c62
+    DO_TEST("smp-dies", QEMU_CAPS_SMP_DIES);
d76c62
 
d76c62
     DO_TEST("iothreads", QEMU_CAPS_OBJECT_IOTHREAD);
d76c62
     DO_TEST("iothreads-ids", QEMU_CAPS_OBJECT_IOTHREAD);
d76c62
-- 
d76c62
2.25.0
d76c62