]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: introduce hugepages-nodeset
authorPavel Hrdina <phrdina@redhat.com>
Wed, 8 Aug 2018 14:53:45 +0000 (16:53 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Fri, 10 Aug 2018 15:06:48 +0000 (17:06 +0200)
This use-case was broken by commit
<fa6bdf6afa878b8d7c5ed71664ee72be8967cdc5>.

We allowed this configuration and it was working as expected therefore
we can consider it as regression.  We should have never allowed such
configuration so now the best solution is in case of non-numa guest
silently ignore the 'nodeset' attribute if it's set to '0'.

That will be fixed by following patches.

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

diff --git a/tests/qemuxml2argvdata/hugepages-nodeset.xml b/tests/qemuxml2argvdata/hugepages-nodeset.xml
new file mode 100644 (file)
index 0000000..4a85ddf
--- /dev/null
@@ -0,0 +1,30 @@
+<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='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 529f36c504fbf70e3a80c8adac68777ab3d99a30..7721827f40eff5345ee5a73b2b3b53c021970e5b 100644 (file)
@@ -959,6 +959,7 @@ mymain(void)
     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", NONE);
     DO_TEST_FAILURE("hugepages-nodeset-nonexist",
                     QEMU_CAPS_DEVICE_PC_DIMM,
                     QEMU_CAPS_OBJECT_MEMORY_FILE,
diff --git a/tests/qemuxml2xmloutdata/hugepages-nodeset.xml b/tests/qemuxml2xmloutdata/hugepages-nodeset.xml
new file mode 120000 (symlink)
index 0000000..b55838b
--- /dev/null
@@ -0,0 +1 @@
+../qemuxml2argvdata/hugepages-nodeset.xml
\ No newline at end of file
index da6aadd884ad0bea2f29baef4a4ce95379f641be..7c4a649a6e8cc1fe8a643cbe51f873587a96b3b1 100644 (file)
@@ -332,6 +332,7 @@ mymain(void)
     DO_TEST("hugepages-default-2M", NONE);
     DO_TEST("hugepages-default-system-size", NONE);
     DO_TEST("hugepages-default-1G-nodeset-2M", NONE);
+    DO_TEST("hugepages-nodeset", NONE);
     DO_TEST("hugepages-numa-default-2M", NONE);
     DO_TEST("hugepages-numa-default-dimm", NONE);
     DO_TEST("hugepages-numa-nodeset", NONE);