render / rpms / libvirt

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