render / rpms / libvirt

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