From b1ad796106c4f1e889312c67164cce53b01cbc17 Mon Sep 17 00:00:00 2001 Message-Id: From: Pavel Hrdina Date: Mon, 13 Aug 2018 19:21:50 +0200 Subject: [PATCH] tests: introduce hugepages-default-1G-nodeset-2M MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit 6ff69e936e4185983fc331c45b76d3b3d8b717ae) Conflicts: tests/qemuxml2argvdata/hugepages-default-1G-nodeset-2M.args - missing upstream commit Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1615461 Signed-off-by: Pavel Hrdina Reviewed-by: Ján Tomko --- .../hugepages-default-1G-nodeset-2M.args | 26 ++++++++++++++++ .../hugepages-default-1G-nodeset-2M.xml | 31 +++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + .../hugepages-default-1G-nodeset-2M.xml | 1 + tests/qemuxml2xmltest.c | 1 + 5 files changed, 60 insertions(+) create mode 100644 tests/qemuxml2argvdata/hugepages-default-1G-nodeset-2M.args create mode 100644 tests/qemuxml2argvdata/hugepages-default-1G-nodeset-2M.xml create mode 120000 tests/qemuxml2xmloutdata/hugepages-default-1G-nodeset-2M.xml diff --git a/tests/qemuxml2argvdata/hugepages-default-1G-nodeset-2M.args b/tests/qemuxml2argvdata/hugepages-default-1G-nodeset-2M.args new file mode 100644 index 0000000000..d1f8974032 --- /dev/null +++ b/tests/qemuxml2argvdata/hugepages-default-1G-nodeset-2M.args @@ -0,0 +1,26 @@ +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 \ +-boot c \ +-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 index 0000000000..eb0943b105 --- /dev/null +++ b/tests/qemuxml2argvdata/hugepages-default-1G-nodeset-2M.xml @@ -0,0 +1,31 @@ + + 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 d4251eff3e..f92c46cec5 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -959,6 +959,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 index 0000000000..3d8eb7616e --- /dev/null +++ b/tests/qemuxml2xmloutdata/hugepages-default-1G-nodeset-2M.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/hugepages-default-1G-nodeset-2M.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 6afc48f98e..6ba8f97e20 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -336,6 +336,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); -- 2.18.0