From d4bb90f58723489d9e25c09f4b709130d59d0274 Mon Sep 17 00:00:00 2001 Message-Id: From: Pavel Hrdina Date: Mon, 13 Aug 2018 19:21:40 +0200 Subject: [PATCH] tests: extract pages-discard out of hugepages-pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit >From the args output you can see that the 'discard' feature is not honored if you don't use hugepages, that is a bug, following patche will fix it. Signed-off-by: Pavel Hrdina (cherry picked from commit aa6a5e09953fea6d379dcb3a330a3fb6d0cf0a0b) Conflicts: tests/qemuxml2argvdata/pages-discard.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-pages.args | 12 +++---- tests/qemuxml2argvdata/hugepages-pages.xml | 3 +- tests/qemuxml2argvdata/pages-discard.args | 28 +++++++++++++++ tests/qemuxml2argvdata/pages-discard.xml | 36 ++++++++++++++++++++ tests/qemuxml2argvtest.c | 6 ++-- tests/qemuxml2xmloutdata/hugepages-pages.xml | 3 +- tests/qemuxml2xmloutdata/pages-discard.xml | 1 + tests/qemuxml2xmltest.c | 1 + 8 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 tests/qemuxml2argvdata/pages-discard.args create mode 100644 tests/qemuxml2argvdata/pages-discard.xml create mode 120000 tests/qemuxml2xmloutdata/pages-discard.xml diff --git a/tests/qemuxml2argvdata/hugepages-pages.args b/tests/qemuxml2argvdata/hugepages-pages.args index b52cd581d5..7ece0272a0 100644 --- a/tests/qemuxml2argvdata/hugepages-pages.args +++ b/tests/qemuxml2argvdata/hugepages-pages.args @@ -11,20 +11,20 @@ QEMU_AUDIO_DRV=none \ -m 4096 \ -smp 4,sockets=4,cores=1,threads=1 \ -object memory-backend-file,id=ram-node0,prealloc=yes,\ -mem-path=/dev/hugepages1G/libvirt/qemu/-1-QEMUGuest1,discard-data=yes,\ -size=1073741824,host-nodes=0-3,policy=bind \ +mem-path=/dev/hugepages1G/libvirt/qemu/-1-QEMUGuest1,size=1073741824,\ +host-nodes=0-3,policy=bind \ -numa node,nodeid=0,cpus=0,memdev=ram-node0 \ -object memory-backend-file,id=ram-node1,prealloc=yes,\ mem-path=/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1,size=1073741824,\ host-nodes=0-3,policy=bind \ -numa node,nodeid=1,cpus=1,memdev=ram-node1 \ -object memory-backend-file,id=ram-node2,prealloc=yes,\ -mem-path=/dev/hugepages1G/libvirt/qemu/-1-QEMUGuest1,discard-data=yes,\ -size=1073741824,host-nodes=0-3,policy=bind \ +mem-path=/dev/hugepages1G/libvirt/qemu/-1-QEMUGuest1,size=1073741824,\ +host-nodes=0-3,policy=bind \ -numa node,nodeid=2,cpus=2,memdev=ram-node2 \ -object memory-backend-file,id=ram-node3,prealloc=yes,\ -mem-path=/dev/hugepages1G/libvirt/qemu/-1-QEMUGuest1,discard-data=yes,\ -size=1073741824,host-nodes=3,policy=bind \ +mem-path=/dev/hugepages1G/libvirt/qemu/-1-QEMUGuest1,size=1073741824,\ +host-nodes=3,policy=bind \ -numa node,nodeid=3,cpus=3,memdev=ram-node3 \ -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -display none \ diff --git a/tests/qemuxml2argvdata/hugepages-pages.xml b/tests/qemuxml2argvdata/hugepages-pages.xml index cba83e754c..f9270782d4 100644 --- a/tests/qemuxml2argvdata/hugepages-pages.xml +++ b/tests/qemuxml2argvdata/hugepages-pages.xml @@ -8,7 +8,6 @@ - 4 @@ -22,7 +21,7 @@ - + diff --git a/tests/qemuxml2argvdata/pages-discard.args b/tests/qemuxml2argvdata/pages-discard.args new file mode 100644 index 0000000000..9db8c72a22 --- /dev/null +++ b/tests/qemuxml2argvdata/pages-discard.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 QEMUGuest1 \ +-S \ +-machine pc,accel=tcg,usb=off,dump-guest-core=off \ +-m 4096 \ +-smp 4,sockets=4,cores=1,threads=1 \ +-numa node,nodeid=0,cpus=0,mem=1024 \ +-numa node,nodeid=1,cpus=1,mem=1024 \ +-numa node,nodeid=2,cpus=2,mem=1024 \ +-numa node,nodeid=3,cpus=3,mem=1024 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/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.xml b/tests/qemuxml2argvdata/pages-discard.xml new file mode 100644 index 0000000000..a8c6b74d95 --- /dev/null +++ b/tests/qemuxml2argvdata/pages-discard.xml @@ -0,0 +1,36 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 4194304 + 4194304 + + + + 4 + + hvm + + + + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + +
+ + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 19fb7a0931..ea26d17a63 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -945,6 +945,9 @@ mymain(void) DO_TEST("pmu-feature", NONE); DO_TEST("pmu-feature-off", NONE); + DO_TEST("pages-discard", + 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); @@ -953,8 +956,7 @@ mymain(void) QEMU_CAPS_OBJECT_MEMORY_FILE); DO_TEST("hugepages-pages", QEMU_CAPS_OBJECT_MEMORY_RAM, - QEMU_CAPS_OBJECT_MEMORY_FILE, - QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD); + QEMU_CAPS_OBJECT_MEMORY_FILE); DO_TEST("hugepages-pages2", QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE); DO_TEST("hugepages-pages3", QEMU_CAPS_OBJECT_MEMORY_RAM, diff --git a/tests/qemuxml2xmloutdata/hugepages-pages.xml b/tests/qemuxml2xmloutdata/hugepages-pages.xml index 292454588e..498610a217 100644 --- a/tests/qemuxml2xmloutdata/hugepages-pages.xml +++ b/tests/qemuxml2xmloutdata/hugepages-pages.xml @@ -8,7 +8,6 @@ - 4 @@ -22,7 +21,7 @@ - + diff --git a/tests/qemuxml2xmloutdata/pages-discard.xml b/tests/qemuxml2xmloutdata/pages-discard.xml new file mode 120000 index 0000000000..4d22fef81f --- /dev/null +++ b/tests/qemuxml2xmloutdata/pages-discard.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/pages-discard.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 5900f4de61..b4bd9ebc4c 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -330,6 +330,7 @@ mymain(void) DO_TEST("pmu-feature", NONE); DO_TEST("pmu-feature-off", NONE); + DO_TEST("pages-discard", NONE); DO_TEST("hugepages-default", NONE); DO_TEST("hugepages-numa-default-dimm", NONE); DO_TEST("hugepages-pages", NONE); -- 2.18.0