Signed-off-by: Han Han <hhan@xxxxxxxxxx> --- .../qemuxml2argvdata/hugepages-anonymous.err | 1 + .../qemuxml2argvdata/hugepages-anonymous.xml | 25 +++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + 3 files changed, 27 insertions(+) create mode 100644 tests/qemuxml2argvdata/hugepages-anonymous.err create mode 100644 tests/qemuxml2argvdata/hugepages-anonymous.xml diff --git a/tests/qemuxml2argvdata/hugepages-anonymous.err b/tests/qemuxml2argvdata/hugepages-anonymous.err new file mode 100644 index 0000000000..f4ebbf1d1d --- /dev/null +++ b/tests/qemuxml2argvdata/hugepages-anonymous.err @@ -0,0 +1 @@ +unsupported configuration: hugepages are not allowed with anonymous memory source diff --git a/tests/qemuxml2argvdata/hugepages-anonymous.xml b/tests/qemuxml2argvdata/hugepages-anonymous.xml new file mode 100644 index 0000000000..e7ed1f1c51 --- /dev/null +++ b/tests/qemuxml2argvdata/hugepages-anonymous.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/> + <source type="anonymous"/> + </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 12c2b68fd7..6cf1044173 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1268,6 +1268,7 @@ mymain(void) QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE); DO_TEST_PARSE_ERROR("hugepages-memaccess-invalid", NONE); + DO_TEST_PARSE_ERROR("hugepages-anonymous", 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