]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: introduce hugepages-default-1G-nodeset-2M
authorPavel Hrdina <phrdina@redhat.com>
Wed, 8 Aug 2018 13:59:27 +0000 (15:59 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Fri, 10 Aug 2018 15:06:48 +0000 (17:06 +0200)
This test case is currently working but it uncovers existing issue
in our code that the generated QEMU commandline uses the default 1G
hugepage instead of the 2M hugepage specified for exact node.

The issue in our code is that for non-numa guests we take into account
only the first hugepage.  This will be fixed as invalid configuration
since it doesn't make any sense to set default and specific hugepage
for non-numa guest.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
tests/qemuxml2argvdata/hugepages-default-1G-nodeset-2M.args [new file with mode: 0644]
tests/qemuxml2argvdata/hugepages-default-1G-nodeset-2M.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/hugepages-default-1G-nodeset-2M.xml [new symlink]
tests/qemuxml2xmltest.c

diff --git a/tests/qemuxml2argvdata/hugepages-default-1G-nodeset-2M.args b/tests/qemuxml2argvdata/hugepages-default-1G-nodeset-2M.args
new file mode 100644 (file)
index 0000000..10c429a
--- /dev/null
@@ -0,0 +1,25 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name SomeDummyHugepagesGuest \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 1024 \
+-mem-prealloc \
+-mem-path /dev/hugepages1G/libvirt/qemu/-1-SomeDummyHugepagesGu \
+-smp 2,sockets=2,cores=1,threads=1 \
+-uuid ef1bdff4-27f3-4e85-a807-5fb4d58463cc \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,\
+path=/tmp/lib/domain--1-SomeDummyHugepagesGu/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-default-1G-nodeset-2M.xml b/tests/qemuxml2argvdata/hugepages-default-1G-nodeset-2M.xml
new file mode 100644 (file)
index 0000000..eb0943b
--- /dev/null
@@ -0,0 +1,31 @@
+<domain type='qemu'>
+  <name>SomeDummyHugepagesGuest</name>
+  <uuid>ef1bdff4-27f3-4e85-a807-5fb4d58463cc</uuid>
+  <memory unit='KiB'>1048576</memory>
+  <currentMemory unit='KiB'>1048576</currentMemory>
+  <memoryBacking>
+    <hugepages>
+      <page size='1048576' unit='KiB'/>
+      <page size='2048' unit='KiB' nodeset='0'/>
+    </hugepages>
+  </memoryBacking>
+  <vcpu placement='static'>2</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-i686</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'/>
+  </devices>
+</domain>
index 7b3050fd0d03f4fcd7dea9c305f6f497784e239b..529f36c504fbf70e3a80c8adac68777ab3d99a30 100644 (file)
@@ -958,6 +958,7 @@ mymain(void)
     DO_TEST("hugepages-default", NONE);
     DO_TEST("hugepages-default-2M", NONE);
     DO_TEST("hugepages-default-system-size", NONE);
+    DO_TEST("hugepages-default-1G-nodeset-2M", NONE);
     DO_TEST_FAILURE("hugepages-nodeset-nonexist",
                     QEMU_CAPS_DEVICE_PC_DIMM,
                     QEMU_CAPS_OBJECT_MEMORY_FILE,
diff --git a/tests/qemuxml2xmloutdata/hugepages-default-1G-nodeset-2M.xml b/tests/qemuxml2xmloutdata/hugepages-default-1G-nodeset-2M.xml
new file mode 120000 (symlink)
index 0000000..3d8eb76
--- /dev/null
@@ -0,0 +1 @@
+../qemuxml2argvdata/hugepages-default-1G-nodeset-2M.xml
\ No newline at end of file
index 64ec2679485c55cfc4b3439e66e3c7a1c51ae178..da6aadd884ad0bea2f29baef4a4ce95379f641be 100644 (file)
@@ -331,6 +331,7 @@ mymain(void)
     DO_TEST("hugepages-default", NONE);
     DO_TEST("hugepages-default-2M", NONE);
     DO_TEST("hugepages-default-system-size", NONE);
+    DO_TEST("hugepages-default-1G-nodeset-2M", NONE);
     DO_TEST("hugepages-numa-default-2M", NONE);
     DO_TEST("hugepages-numa-default-dimm", NONE);
     DO_TEST("hugepages-numa-nodeset", NONE);