[PATCH 2/3] tests: negative test for hugepages with ondemand mode

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

 



Signed-off-by: Han Han <hhan@xxxxxxxxxx>
---
 tests/qemuxml2argvdata/hugepages-ondemand.err |  1 +
 tests/qemuxml2argvdata/hugepages-ondemand.xml | 25 +++++++++++++++++++
 tests/qemuxml2argvtest.c                      |  1 +
 3 files changed, 27 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/hugepages-ondemand.err
 create mode 100644 tests/qemuxml2argvdata/hugepages-ondemand.xml

diff --git a/tests/qemuxml2argvdata/hugepages-ondemand.err b/tests/qemuxml2argvdata/hugepages-ondemand.err
new file mode 100644
index 0000000000..9f27a76b68
--- /dev/null
+++ b/tests/qemuxml2argvdata/hugepages-ondemand.err
@@ -0,0 +1 @@
+unsupported configuration: hugepages are not allowed with memory allocation ondemand
diff --git a/tests/qemuxml2argvdata/hugepages-ondemand.xml b/tests/qemuxml2argvdata/hugepages-ondemand.xml
new file mode 100644
index 0000000000..58920d0150
--- /dev/null
+++ b/tests/qemuxml2argvdata/hugepages-ondemand.xml
@@ -0,0 +1,25 @@
+<domain type='qemu'>
+  <name>QEMUGuest</name>
+  <uuid>9f4b6512-e73a-4a25-93e8-5307802821ce</uuid>
+  <memory unit='KiB'>24682468</memory>
+  <currentMemory unit='KiB'>24682468</currentMemory>
+  <memoryBacking>
+    <hugepages/>
+    <allocation mode="ondemand"/>
+  </memoryBacking>
+  <vcpu placement='static'>32</vcpu>
+  <os>
+    <type arch='x86_64' 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-x86_64</emulator>
+    <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <memballoon model='virtio'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 6cf1044173..ea38238823 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1269,6 +1269,7 @@ mymain(void)
             QEMU_CAPS_OBJECT_MEMORY_FILE);
     DO_TEST_PARSE_ERROR("hugepages-memaccess-invalid", NONE);
     DO_TEST_PARSE_ERROR("hugepages-anonymous", NONE);
+    DO_TEST_PARSE_ERROR("hugepages-ondemand", NONE);
     DO_TEST("hugepages-memaccess", QEMU_CAPS_OBJECT_MEMORY_FILE,
             QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_DEVICE_PC_DIMM,
             QEMU_CAPS_NUMA);
-- 
2.30.2




[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