[PATCH v2 02/20] tests: extract hugepages-numa-default-dimm out of hugepages-numa

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 .../hugepages-numa-default-dimm.args          | 31 +++++++++++++
 .../hugepages-numa-default-dimm.xml           | 45 +++++++++++++++++++
 tests/qemuxml2argvdata/hugepages-numa.args    |  6 +--
 tests/qemuxml2argvdata/hugepages-numa.xml     | 11 -----
 tests/qemuxml2argvtest.c                      |  2 +
 .../hugepages-numa-default-dimm.xml           |  1 +
 tests/qemuxml2xmltest.c                       |  1 +
 7 files changed, 81 insertions(+), 16 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/hugepages-numa-default-dimm.args
 create mode 100644 tests/qemuxml2argvdata/hugepages-numa-default-dimm.xml
 create mode 120000 tests/qemuxml2xmloutdata/hugepages-numa-default-dimm.xml

diff --git a/tests/qemuxml2argvdata/hugepages-numa-default-dimm.args b/tests/qemuxml2argvdata/hugepages-numa-default-dimm.args
new file mode 100644
index 0000000000..855966a137
--- /dev/null
+++ b/tests/qemuxml2argvdata/hugepages-numa-default-dimm.args
@@ -0,0 +1,31 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-x86_64 \
+-name fedora \
+-S \
+-machine pc-i440fx-2.3,accel=tcg,usb=off,dump-guest-core=off \
+-m size=1048576k,slots=16,maxmem=1099511627776k \
+-smp 2,sockets=2,cores=1,threads=1 \
+-mem-prealloc \
+-mem-path /dev/hugepages2M/libvirt/qemu/-1-fedora \
+-numa node,nodeid=0,cpus=0-1,mem=1024 \
+-object memory-backend-file,id=memdimm0,prealloc=yes,\
+mem-path=/dev/hugepages1G/libvirt/qemu/-1-fedora,size=1073741824,\
+host-nodes=1-3,policy=bind \
+-device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0 \
+-uuid 63840878-0deb-4095-97e6-fc444d9bc9fa \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-fedora/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot c \
+-usb
diff --git a/tests/qemuxml2argvdata/hugepages-numa-default-dimm.xml b/tests/qemuxml2argvdata/hugepages-numa-default-dimm.xml
new file mode 100644
index 0000000000..14a3368678
--- /dev/null
+++ b/tests/qemuxml2argvdata/hugepages-numa-default-dimm.xml
@@ -0,0 +1,45 @@
+<domain type='qemu'>
+  <name>fedora</name>
+  <uuid>63840878-0deb-4095-97e6-fc444d9bc9fa</uuid>
+  <maxMemory slots='16' unit='KiB'>1099511627776</maxMemory>
+  <memory unit='KiB'>1572863</memory>
+  <currentMemory unit='KiB'>1048576</currentMemory>
+  <memoryBacking>
+    <hugepages/>
+  </memoryBacking>
+  <vcpu placement='static'>2</vcpu>
+  <os>
+    <type arch='x86_64' machine='pc-i440fx-2.3'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <cpu>
+    <numa>
+      <cell id='0' cpus='0-1' memory='1048576' unit='KiB'/>
+    </numa>
+  </cpu>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <controller type='usb' index='0'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+    <memory model='dimm'>
+      <source>
+        <nodemask>1-3</nodemask>
+        <pagesize unit='KiB'>1048576</pagesize>
+      </source>
+      <target>
+        <size unit='KiB'>1048576</size>
+        <node>0</node>
+      </target>
+      <address type='dimm' slot='0'/>
+    </memory>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/hugepages-numa.args b/tests/qemuxml2argvdata/hugepages-numa.args
index aa834f5511..20c7802fd8 100644
--- a/tests/qemuxml2argvdata/hugepages-numa.args
+++ b/tests/qemuxml2argvdata/hugepages-numa.args
@@ -8,15 +8,11 @@ QEMU_AUDIO_DRV=spice \
 -name fedora \
 -S \
 -machine pc-i440fx-2.3,accel=tcg,usb=off,dump-guest-core=off \
--m size=1048576k,slots=16,maxmem=1099511627776k \
+-m 1024 \
 -smp 2,sockets=2,cores=1,threads=1 \
 -mem-prealloc \
 -mem-path /dev/hugepages2M/libvirt/qemu/-1-fedora \
 -numa node,nodeid=0,cpus=0-1,mem=1024 \
--object memory-backend-file,id=memdimm0,prealloc=yes,\
-mem-path=/dev/hugepages1G/libvirt/qemu/-1-fedora,size=1073741824,\
-host-nodes=1-3,policy=bind \
--device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0 \
 -uuid 63840878-0deb-4095-97e6-fc444d9bc9fa \
 -no-user-config \
 -nodefaults \
diff --git a/tests/qemuxml2argvdata/hugepages-numa.xml b/tests/qemuxml2argvdata/hugepages-numa.xml
index eef471b4ec..d3c6308be0 100644
--- a/tests/qemuxml2argvdata/hugepages-numa.xml
+++ b/tests/qemuxml2argvdata/hugepages-numa.xml
@@ -1,7 +1,6 @@
 <domain type='qemu'>
   <name>fedora</name>
   <uuid>63840878-0deb-4095-97e6-fc444d9bc9fa</uuid>
-  <maxMemory slots='16' unit='KiB'>1099511627776</maxMemory>
   <memory unit='KiB'>1572863</memory>
   <currentMemory unit='KiB'>1048576</currentMemory>
   <memoryBacking>
@@ -97,15 +96,5 @@
     <memballoon model='virtio'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
     </memballoon>
-    <memory model='dimm'>
-      <source>
-        <nodemask>1-3</nodemask>
-        <pagesize unit='KiB'>1048576</pagesize>
-      </source>
-      <target>
-        <size unit='KiB'>1048576</size>
-        <node>0</node>
-      </target>
-    </memory>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index cfebf364fb..1631663bc6 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -968,6 +968,8 @@ mymain(void)
             QEMU_CAPS_SPICE,
             QEMU_CAPS_DEVICE_QXL,
             QEMU_CAPS_HDA_DUPLEX, QEMU_CAPS_USB_REDIR,
+            QEMU_CAPS_OBJECT_MEMORY_FILE);
+    DO_TEST("hugepages-numa-default-dimm",
             QEMU_CAPS_DEVICE_PC_DIMM,
             QEMU_CAPS_OBJECT_MEMORY_FILE);
     DO_TEST("hugepages-pages",
diff --git a/tests/qemuxml2xmloutdata/hugepages-numa-default-dimm.xml b/tests/qemuxml2xmloutdata/hugepages-numa-default-dimm.xml
new file mode 120000
index 0000000000..8fa2b323aa
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/hugepages-numa-default-dimm.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/hugepages-numa-default-dimm.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index ff6e611421..a943975ada 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -330,6 +330,7 @@ mymain(void)
     DO_TEST("pmu-feature-off", NONE);
 
     DO_TEST("hugepages-default", NONE);
+    DO_TEST("hugepages-numa-default-dimm", NONE);
     DO_TEST("hugepages-pages", NONE);
     DO_TEST("hugepages-pages2", NONE);
     DO_TEST("hugepages-pages3", NONE);
-- 
2.17.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux