From 75affd738b5f6024066cf8023ccd7fa145828144 Mon Sep 17 00:00:00 2001 Message-Id: <75affd738b5f6024066cf8023ccd7fa145828144@dist-git> From: Pavel Hrdina Date: Mon, 13 Aug 2018 19:21:43 +0200 Subject: [PATCH] tests: extract pages-discard-hugepages out of hugepages-pages3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Similar thing happens as for pages-discard, it is not passed to QEMU. Signed-off-by: Pavel Hrdina (cherry picked from commit 9a6674c0ff5c5857fcf9b8e5aded1f524cf75d44) Conflicts: tests/qemuxml2argvdata/pages-discard-hugepages.args - missing upstream commit Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1615461 Signed-off-by: Pavel Hrdina Reviewed-by: Ján Tomko --- tests/qemuxml2argvdata/hugepages-pages3.args | 3 +- tests/qemuxml2argvdata/hugepages-pages3.xml | 4 +-- .../pages-discard-hugepages.args | 28 +++++++++++++++ .../pages-discard-hugepages.xml | 34 +++++++++++++++++++ tests/qemuxml2argvtest.c | 7 ++-- tests/qemuxml2xmloutdata/hugepages-pages3.xml | 4 +-- .../pages-discard-hugepages.xml | 1 + tests/qemuxml2xmltest.c | 1 + 8 files changed, 74 insertions(+), 8 deletions(-) create mode 100644 tests/qemuxml2argvdata/pages-discard-hugepages.args create mode 100644 tests/qemuxml2argvdata/pages-discard-hugepages.xml create mode 120000 tests/qemuxml2xmloutdata/pages-discard-hugepages.xml diff --git a/tests/qemuxml2argvdata/hugepages-pages3.args b/tests/qemuxml2argvdata/hugepages-pages3.args index d55265cdd8..2fc701ca22 100644 --- a/tests/qemuxml2argvdata/hugepages-pages3.args +++ b/tests/qemuxml2argvdata/hugepages-pages3.args @@ -13,8 +13,7 @@ QEMU_AUDIO_DRV=none \ -object memory-backend-ram,id=ram-node0,size=268435456 \ -numa node,nodeid=0,cpus=0,memdev=ram-node0 \ -object memory-backend-file,id=ram-node1,prealloc=yes,\ -mem-path=/dev/hugepages1G/libvirt/qemu/-1-SomeDummyHugepagesGu,\ -discard-data=yes,size=805306368 \ +mem-path=/dev/hugepages1G/libvirt/qemu/-1-SomeDummyHugepagesGu,size=805306368 \ -numa node,nodeid=1,cpus=1,memdev=ram-node1 \ -uuid ef1bdff4-27f3-4e85-a807-5fb4d58463cc \ -display none \ diff --git a/tests/qemuxml2argvdata/hugepages-pages3.xml b/tests/qemuxml2argvdata/hugepages-pages3.xml index 147acc4c95..3d3b3f3cc3 100644 --- a/tests/qemuxml2argvdata/hugepages-pages3.xml +++ b/tests/qemuxml2argvdata/hugepages-pages3.xml @@ -15,8 +15,8 @@ - - + + diff --git a/tests/qemuxml2argvdata/pages-discard-hugepages.args b/tests/qemuxml2argvdata/pages-discard-hugepages.args new file mode 100644 index 0000000000..2dfacefe4a --- /dev/null +++ b/tests/qemuxml2argvdata/pages-discard-hugepages.args @@ -0,0 +1,28 @@ +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 \ +-smp 2,sockets=2,cores=1,threads=1 \ +-mem-prealloc \ +-mem-path /dev/hugepages2M/libvirt/qemu/-1-SomeDummyHugepagesGu \ +-numa node,nodeid=0,cpus=0,mem=256 \ +-numa node,nodeid=1,cpus=1,mem=768 \ +-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 \ +-boot c \ +-usb diff --git a/tests/qemuxml2argvdata/pages-discard-hugepages.xml b/tests/qemuxml2argvdata/pages-discard-hugepages.xml new file mode 100644 index 0000000000..d1620d1946 --- /dev/null +++ b/tests/qemuxml2argvdata/pages-discard-hugepages.xml @@ -0,0 +1,34 @@ + + SomeDummyHugepagesGuest + ef1bdff4-27f3-4e85-a807-5fb4d58463cc + 1048576 + 1048576 + + + + 2 + + hvm + + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + +
+ + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 6a79918f67..a95d2c1915 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -948,6 +948,10 @@ mymain(void) DO_TEST("pages-discard", QEMU_CAPS_OBJECT_MEMORY_FILE, QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD); + DO_TEST("pages-discard-hugepages", + QEMU_CAPS_OBJECT_MEMORY_RAM, + QEMU_CAPS_OBJECT_MEMORY_FILE, + QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD); DO_TEST("hugepages-default", NONE); DO_TEST("hugepages-numa-default", QEMU_CAPS_OBJECT_MEMORY_FILE); @@ -961,8 +965,7 @@ mymain(void) QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE); DO_TEST("hugepages-pages3", QEMU_CAPS_OBJECT_MEMORY_RAM, - QEMU_CAPS_OBJECT_MEMORY_FILE, - QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD); + QEMU_CAPS_OBJECT_MEMORY_FILE); DO_TEST("hugepages-shared", QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE); diff --git a/tests/qemuxml2xmloutdata/hugepages-pages3.xml b/tests/qemuxml2xmloutdata/hugepages-pages3.xml index 90e6efa5ea..be21c3eddd 100644 --- a/tests/qemuxml2xmloutdata/hugepages-pages3.xml +++ b/tests/qemuxml2xmloutdata/hugepages-pages3.xml @@ -15,8 +15,8 @@ - - + + diff --git a/tests/qemuxml2xmloutdata/pages-discard-hugepages.xml b/tests/qemuxml2xmloutdata/pages-discard-hugepages.xml new file mode 120000 index 0000000000..3d2f0682dc --- /dev/null +++ b/tests/qemuxml2xmloutdata/pages-discard-hugepages.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/pages-discard-hugepages.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index a4448ff168..83c0ffdfe2 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -331,6 +331,7 @@ mymain(void) DO_TEST("pmu-feature-off", NONE); DO_TEST("pages-discard", NONE); + DO_TEST("pages-discard-hugepages", NONE); DO_TEST("hugepages-default", NONE); DO_TEST("hugepages-numa-default-2M", NONE); DO_TEST("hugepages-numa-default-dimm", NONE); -- 2.18.0