render / rpms / libvirt

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