Blame SOURCES/libvirt-tests-extract-hugepages-numa-default-dimm-out-of-hugepages-numa.patch

51d9a2
From da9a421e53b68d479b026a7181be031667c7bed3 Mon Sep 17 00:00:00 2001
51d9a2
Message-Id: <da9a421e53b68d479b026a7181be031667c7bed3@dist-git>
51d9a2
From: Pavel Hrdina <phrdina@redhat.com>
51d9a2
Date: Mon, 13 Aug 2018 18:16:05 +0200
51d9a2
Subject: [PATCH] tests: extract hugepages-numa-default-dimm out of
51d9a2
 hugepages-numa
51d9a2
MIME-Version: 1.0
51d9a2
Content-Type: text/plain; charset=UTF-8
51d9a2
Content-Transfer-Encoding: 8bit
51d9a2
51d9a2
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
51d9a2
(cherry picked from commit c8a8c7ebbabb0d96bf18a7e75e99efbd8ccc6d50)
51d9a2
51d9a2
Conflicts:
51d9a2
    tests/qemuxml2argvdata/hugepages-numa-default-dimm.args
51d9a2
        - missing upstream commit <caccbba64a>
51d9a2
51d9a2
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1591235
51d9a2
51d9a2
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
51d9a2
Reviewed-by: Ján Tomko <jtomko@redhat.com>
51d9a2
---
51d9a2
 .../hugepages-numa-default-dimm.args          | 31 +++++++++++++
51d9a2
 .../hugepages-numa-default-dimm.xml           | 45 +++++++++++++++++++
51d9a2
 tests/qemuxml2argvdata/hugepages-numa.args    |  6 +--
51d9a2
 tests/qemuxml2argvdata/hugepages-numa.xml     | 11 -----
51d9a2
 tests/qemuxml2argvtest.c                      |  2 +
51d9a2
 .../hugepages-numa-default-dimm.xml           |  1 +
51d9a2
 tests/qemuxml2xmltest.c                       |  1 +
51d9a2
 7 files changed, 81 insertions(+), 16 deletions(-)
51d9a2
 create mode 100644 tests/qemuxml2argvdata/hugepages-numa-default-dimm.args
51d9a2
 create mode 100644 tests/qemuxml2argvdata/hugepages-numa-default-dimm.xml
51d9a2
 create mode 120000 tests/qemuxml2xmloutdata/hugepages-numa-default-dimm.xml
51d9a2
51d9a2
diff --git a/tests/qemuxml2argvdata/hugepages-numa-default-dimm.args b/tests/qemuxml2argvdata/hugepages-numa-default-dimm.args
51d9a2
new file mode 100644
51d9a2
index 0000000000..855966a137
51d9a2
--- /dev/null
51d9a2
+++ b/tests/qemuxml2argvdata/hugepages-numa-default-dimm.args
51d9a2
@@ -0,0 +1,31 @@
51d9a2
+LC_ALL=C \
51d9a2
+PATH=/bin \
51d9a2
+HOME=/home/test \
51d9a2
+USER=test \
51d9a2
+LOGNAME=test \
51d9a2
+QEMU_AUDIO_DRV=none \
51d9a2
+/usr/bin/qemu-system-x86_64 \
51d9a2
+-name fedora \
51d9a2
+-S \
51d9a2
+-machine pc-i440fx-2.3,accel=tcg,usb=off,dump-guest-core=off \
51d9a2
+-m size=1048576k,slots=16,maxmem=1099511627776k \
51d9a2
+-smp 2,sockets=2,cores=1,threads=1 \
51d9a2
+-mem-prealloc \
51d9a2
+-mem-path /dev/hugepages2M/libvirt/qemu/-1-fedora \
51d9a2
+-numa node,nodeid=0,cpus=0-1,mem=1024 \
51d9a2
+-object memory-backend-file,id=memdimm0,prealloc=yes,\
51d9a2
+mem-path=/dev/hugepages1G/libvirt/qemu/-1-fedora,size=1073741824,\
51d9a2
+host-nodes=1-3,policy=bind \
51d9a2
+-device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0 \
51d9a2
+-uuid 63840878-0deb-4095-97e6-fc444d9bc9fa \
51d9a2
+-display none \
51d9a2
+-no-user-config \
51d9a2
+-nodefaults \
51d9a2
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-fedora/monitor.sock,\
51d9a2
+server,nowait \
51d9a2
+-mon chardev=charmonitor,id=monitor,mode=control \
51d9a2
+-rtc base=utc \
51d9a2
+-no-shutdown \
51d9a2
+-no-acpi \
51d9a2
+-boot c \
51d9a2
+-usb
51d9a2
diff --git a/tests/qemuxml2argvdata/hugepages-numa-default-dimm.xml b/tests/qemuxml2argvdata/hugepages-numa-default-dimm.xml
51d9a2
new file mode 100644
51d9a2
index 0000000000..14a3368678
51d9a2
--- /dev/null
51d9a2
+++ b/tests/qemuxml2argvdata/hugepages-numa-default-dimm.xml
51d9a2
@@ -0,0 +1,45 @@
51d9a2
+<domain type='qemu'>
51d9a2
+  <name>fedora</name>
51d9a2
+  <uuid>63840878-0deb-4095-97e6-fc444d9bc9fa</uuid>
51d9a2
+  <maxMemory slots='16' unit='KiB'>1099511627776</maxMemory>
51d9a2
+  <memory unit='KiB'>1572863</memory>
51d9a2
+  <currentMemory unit='KiB'>1048576</currentMemory>
51d9a2
+  <memoryBacking>
51d9a2
+    <hugepages/>
51d9a2
+  </memoryBacking>
51d9a2
+  <vcpu placement='static'>2</vcpu>
51d9a2
+  <os>
51d9a2
+    <type arch='x86_64' machine='pc-i440fx-2.3'>hvm</type>
51d9a2
+    <boot dev='hd'/>
51d9a2
+  </os>
51d9a2
+  <cpu>
51d9a2
+    <numa>
51d9a2
+      <cell id='0' cpus='0-1' memory='1048576' unit='KiB'/>
51d9a2
+    </numa>
51d9a2
+  </cpu>
51d9a2
+  <clock offset='utc'/>
51d9a2
+  <on_poweroff>destroy</on_poweroff>
51d9a2
+  <on_reboot>restart</on_reboot>
51d9a2
+  <on_crash>destroy</on_crash>
51d9a2
+  <devices>
51d9a2
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
51d9a2
+    <controller type='usb' index='0'>
51d9a2
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
51d9a2
+    </controller>
51d9a2
+    <controller type='pci' index='0' model='pci-root'/>
51d9a2
+    <input type='mouse' bus='ps2'/>
51d9a2
+    <input type='keyboard' bus='ps2'/>
51d9a2
+    <memballoon model='none'/>
51d9a2
+    <memory model='dimm'>
51d9a2
+      <source>
51d9a2
+        <nodemask>1-3</nodemask>
51d9a2
+        <pagesize unit='KiB'>1048576</pagesize>
51d9a2
+      </source>
51d9a2
+      <target>
51d9a2
+        <size unit='KiB'>1048576</size>
51d9a2
+        <node>0</node>
51d9a2
+      </target>
51d9a2
+      <address type='dimm' slot='0'/>
51d9a2
+    </memory>
51d9a2
+  </devices>
51d9a2
+</domain>
51d9a2
diff --git a/tests/qemuxml2argvdata/hugepages-numa.args b/tests/qemuxml2argvdata/hugepages-numa.args
51d9a2
index aa834f5511..20c7802fd8 100644
51d9a2
--- a/tests/qemuxml2argvdata/hugepages-numa.args
51d9a2
+++ b/tests/qemuxml2argvdata/hugepages-numa.args
51d9a2
@@ -8,15 +8,11 @@ QEMU_AUDIO_DRV=spice \
51d9a2
 -name fedora \
51d9a2
 -S \
51d9a2
 -machine pc-i440fx-2.3,accel=tcg,usb=off,dump-guest-core=off \
51d9a2
--m size=1048576k,slots=16,maxmem=1099511627776k \
51d9a2
+-m 1024 \
51d9a2
 -smp 2,sockets=2,cores=1,threads=1 \
51d9a2
 -mem-prealloc \
51d9a2
 -mem-path /dev/hugepages2M/libvirt/qemu/-1-fedora \
51d9a2
 -numa node,nodeid=0,cpus=0-1,mem=1024 \
51d9a2
--object memory-backend-file,id=memdimm0,prealloc=yes,\
51d9a2
-mem-path=/dev/hugepages1G/libvirt/qemu/-1-fedora,size=1073741824,\
51d9a2
-host-nodes=1-3,policy=bind \
51d9a2
--device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0 \
51d9a2
 -uuid 63840878-0deb-4095-97e6-fc444d9bc9fa \
51d9a2
 -no-user-config \
51d9a2
 -nodefaults \
51d9a2
diff --git a/tests/qemuxml2argvdata/hugepages-numa.xml b/tests/qemuxml2argvdata/hugepages-numa.xml
51d9a2
index eef471b4ec..d3c6308be0 100644
51d9a2
--- a/tests/qemuxml2argvdata/hugepages-numa.xml
51d9a2
+++ b/tests/qemuxml2argvdata/hugepages-numa.xml
51d9a2
@@ -1,7 +1,6 @@
51d9a2
 <domain type='qemu'>
51d9a2
   <name>fedora</name>
51d9a2
   <uuid>63840878-0deb-4095-97e6-fc444d9bc9fa</uuid>
51d9a2
-  <maxMemory slots='16' unit='KiB'>1099511627776</maxMemory>
51d9a2
   <memory unit='KiB'>1572863</memory>
51d9a2
   <currentMemory unit='KiB'>1048576</currentMemory>
51d9a2
   <memoryBacking>
51d9a2
@@ -97,15 +96,5 @@
51d9a2
     <memballoon model='virtio'>
51d9a2
       <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
51d9a2
     </memballoon>
51d9a2
-    <memory model='dimm'>
51d9a2
-      <source>
51d9a2
-        <nodemask>1-3</nodemask>
51d9a2
-        <pagesize unit='KiB'>1048576</pagesize>
51d9a2
-      </source>
51d9a2
-      <target>
51d9a2
-        <size unit='KiB'>1048576</size>
51d9a2
-        <node>0</node>
51d9a2
-      </target>
51d9a2
-    </memory>
51d9a2
   </devices>
51d9a2
 </domain>
51d9a2
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
51d9a2
index 01553ada38..a97b48525a 100644
51d9a2
--- a/tests/qemuxml2argvtest.c
51d9a2
+++ b/tests/qemuxml2argvtest.c
51d9a2
@@ -953,6 +953,8 @@ mymain(void)
51d9a2
             QEMU_CAPS_SPICE,
51d9a2
             QEMU_CAPS_DEVICE_QXL,
51d9a2
             QEMU_CAPS_HDA_DUPLEX, QEMU_CAPS_USB_REDIR,
51d9a2
+            QEMU_CAPS_OBJECT_MEMORY_FILE);
51d9a2
+    DO_TEST("hugepages-numa-default-dimm",
51d9a2
             QEMU_CAPS_DEVICE_PC_DIMM,
51d9a2
             QEMU_CAPS_OBJECT_MEMORY_FILE);
51d9a2
     DO_TEST("hugepages-pages",
51d9a2
diff --git a/tests/qemuxml2xmloutdata/hugepages-numa-default-dimm.xml b/tests/qemuxml2xmloutdata/hugepages-numa-default-dimm.xml
51d9a2
new file mode 120000
51d9a2
index 0000000000..8fa2b323aa
51d9a2
--- /dev/null
51d9a2
+++ b/tests/qemuxml2xmloutdata/hugepages-numa-default-dimm.xml
51d9a2
@@ -0,0 +1 @@
51d9a2
+../qemuxml2argvdata/hugepages-numa-default-dimm.xml
51d9a2
\ No newline at end of file
51d9a2
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
51d9a2
index f0cabc422d..5900f4de61 100644
51d9a2
--- a/tests/qemuxml2xmltest.c
51d9a2
+++ b/tests/qemuxml2xmltest.c
51d9a2
@@ -331,6 +331,7 @@ mymain(void)
51d9a2
     DO_TEST("pmu-feature-off", NONE);
51d9a2
 
51d9a2
     DO_TEST("hugepages-default", NONE);
51d9a2
+    DO_TEST("hugepages-numa-default-dimm", NONE);
51d9a2
     DO_TEST("hugepages-pages", NONE);
51d9a2
     DO_TEST("hugepages-pages2", NONE);
51d9a2
     DO_TEST("hugepages-pages3", NONE);
51d9a2
-- 
51d9a2
2.18.0
51d9a2