]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: extract hugepages-numa-default-dimm out of hugepages-numa
authorPavel Hrdina <phrdina@redhat.com>
Tue, 7 Aug 2018 15:00:02 +0000 (17:00 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Fri, 10 Aug 2018 15:06:48 +0000 (17:06 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
tests/qemuxml2argvdata/hugepages-numa-default-dimm.args [new file with mode: 0644]
tests/qemuxml2argvdata/hugepages-numa-default-dimm.xml [new file with mode: 0644]
tests/qemuxml2argvdata/hugepages-numa.args
tests/qemuxml2argvdata/hugepages-numa.xml
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/hugepages-numa-default-dimm.xml [new symlink]
tests/qemuxml2xmltest.c

diff --git a/tests/qemuxml2argvdata/hugepages-numa-default-dimm.args b/tests/qemuxml2argvdata/hugepages-numa-default-dimm.args
new file mode 100644 (file)
index 0000000..143d8b0
--- /dev/null
@@ -0,0 +1,30 @@
+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 \
+-usb
diff --git a/tests/qemuxml2argvdata/hugepages-numa-default-dimm.xml b/tests/qemuxml2argvdata/hugepages-numa-default-dimm.xml
new file mode 100644 (file)
index 0000000..14a3368
--- /dev/null
@@ -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>
index 8f59210e4b0e85ca47a50f9c3e732fc459b67697..f21ed4b888445706f718690b29a7a2a01f93a896 100644 (file)
@@ -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 \
index eef471b4ece76111f547503e8f5e73a75c637464..d3c6308be0fb83ae477898c37f4b1c1b18dc3939 100644 (file)
@@ -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>
     <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>
index 5b309cb9aad8fcb039f82d91b8d7f7cd6f901ab0..a5257bde5807b07a5d49f96aec944fae47652ca7 100644 (file)
@@ -952,6 +952,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 (symlink)
index 0000000..8fa2b32
--- /dev/null
@@ -0,0 +1 @@
+../qemuxml2argvdata/hugepages-numa-default-dimm.xml
\ No newline at end of file
index 31617b1cc12cf0b737178cc309a5eca4cee6a2e7..97286295cc2e4c7bb15e01f9132815bcd4aeabec 100644 (file)
@@ -326,6 +326,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);