Blame SOURCES/libvirt-tests-extract-pages-discard-hugepages-out-of-hugepages-pages3.patch

982648
From 836a7bbfff3c9f8a1aafad455dade0f64b6fa57d Mon Sep 17 00:00:00 2001
982648
Message-Id: <836a7bbfff3c9f8a1aafad455dade0f64b6fa57d@dist-git>
982648
From: Pavel Hrdina <phrdina@redhat.com>
982648
Date: Mon, 13 Aug 2018 18:16:11 +0200
982648
Subject: [PATCH] tests: extract pages-discard-hugepages out of
982648
 hugepages-pages3
982648
MIME-Version: 1.0
982648
Content-Type: text/plain; charset=UTF-8
982648
Content-Transfer-Encoding: 8bit
982648
982648
Similar thing happens as for pages-discard, it is not passed to QEMU.
982648
982648
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
982648
(cherry picked from commit 9a6674c0ff5c5857fcf9b8e5aded1f524cf75d44)
982648
982648
Conflicts:
982648
    tests/qemuxml2argvdata/pages-discard-hugepages.args
982648
        - missing upstream commit <caccbba64a>
982648
982648
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1591235
982648
982648
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
982648
Reviewed-by: Ján Tomko <jtomko@redhat.com>
982648
---
982648
 tests/qemuxml2argvdata/hugepages-pages3.args  |  3 +-
982648
 tests/qemuxml2argvdata/hugepages-pages3.xml   |  4 +--
982648
 .../pages-discard-hugepages.args              | 28 +++++++++++++++
982648
 .../pages-discard-hugepages.xml               | 34 +++++++++++++++++++
982648
 tests/qemuxml2argvtest.c                      |  7 ++--
982648
 tests/qemuxml2xmloutdata/hugepages-pages3.xml |  4 +--
982648
 .../pages-discard-hugepages.xml               |  1 +
982648
 tests/qemuxml2xmltest.c                       |  1 +
982648
 8 files changed, 74 insertions(+), 8 deletions(-)
982648
 create mode 100644 tests/qemuxml2argvdata/pages-discard-hugepages.args
982648
 create mode 100644 tests/qemuxml2argvdata/pages-discard-hugepages.xml
982648
 create mode 120000 tests/qemuxml2xmloutdata/pages-discard-hugepages.xml
982648
982648
diff --git a/tests/qemuxml2argvdata/hugepages-pages3.args b/tests/qemuxml2argvdata/hugepages-pages3.args
982648
index d55265cdd8..2fc701ca22 100644
982648
--- a/tests/qemuxml2argvdata/hugepages-pages3.args
982648
+++ b/tests/qemuxml2argvdata/hugepages-pages3.args
982648
@@ -13,8 +13,7 @@ QEMU_AUDIO_DRV=none \
982648
 -object memory-backend-ram,id=ram-node0,size=268435456 \
982648
 -numa node,nodeid=0,cpus=0,memdev=ram-node0 \
982648
 -object memory-backend-file,id=ram-node1,prealloc=yes,\
982648
-mem-path=/dev/hugepages1G/libvirt/qemu/-1-SomeDummyHugepagesGu,\
982648
-discard-data=yes,size=805306368 \
982648
+mem-path=/dev/hugepages1G/libvirt/qemu/-1-SomeDummyHugepagesGu,size=805306368 \
982648
 -numa node,nodeid=1,cpus=1,memdev=ram-node1 \
982648
 -uuid ef1bdff4-27f3-4e85-a807-5fb4d58463cc \
982648
 -display none \
982648
diff --git a/tests/qemuxml2argvdata/hugepages-pages3.xml b/tests/qemuxml2argvdata/hugepages-pages3.xml
982648
index 147acc4c95..3d3b3f3cc3 100644
982648
--- a/tests/qemuxml2argvdata/hugepages-pages3.xml
982648
+++ b/tests/qemuxml2argvdata/hugepages-pages3.xml
982648
@@ -15,8 +15,8 @@
982648
   </os>
982648
   <cpu>
982648
     <numa>
982648
-      <cell id='0' cpus='0' memory='262144' unit='KiB' discard='no'/>
982648
-      <cell id='1' cpus='1' memory='786432' unit='KiB' discard='yes'/>
982648
+      <cell id='0' cpus='0' memory='262144' unit='KiB'/>
982648
+      <cell id='1' cpus='1' memory='786432' unit='KiB'/>
982648
     </numa>
982648
   </cpu>
982648
   <clock offset='utc'/>
982648
diff --git a/tests/qemuxml2argvdata/pages-discard-hugepages.args b/tests/qemuxml2argvdata/pages-discard-hugepages.args
982648
new file mode 100644
982648
index 0000000000..2dfacefe4a
982648
--- /dev/null
982648
+++ b/tests/qemuxml2argvdata/pages-discard-hugepages.args
982648
@@ -0,0 +1,28 @@
982648
+LC_ALL=C \
982648
+PATH=/bin \
982648
+HOME=/home/test \
982648
+USER=test \
982648
+LOGNAME=test \
982648
+QEMU_AUDIO_DRV=none \
982648
+/usr/bin/qemu-system-i686 \
982648
+-name SomeDummyHugepagesGuest \
982648
+-S \
982648
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
982648
+-m 1024 \
982648
+-smp 2,sockets=2,cores=1,threads=1 \
982648
+-mem-prealloc \
982648
+-mem-path /dev/hugepages2M/libvirt/qemu/-1-SomeDummyHugepagesGu \
982648
+-numa node,nodeid=0,cpus=0,mem=256 \
982648
+-numa node,nodeid=1,cpus=1,mem=768 \
982648
+-uuid ef1bdff4-27f3-4e85-a807-5fb4d58463cc \
982648
+-display none \
982648
+-no-user-config \
982648
+-nodefaults \
982648
+-chardev socket,id=charmonitor,\
982648
+path=/tmp/lib/domain--1-SomeDummyHugepagesGu/monitor.sock,server,nowait \
982648
+-mon chardev=charmonitor,id=monitor,mode=control \
982648
+-rtc base=utc \
982648
+-no-shutdown \
982648
+-no-acpi \
982648
+-boot c \
982648
+-usb
982648
diff --git a/tests/qemuxml2argvdata/pages-discard-hugepages.xml b/tests/qemuxml2argvdata/pages-discard-hugepages.xml
982648
new file mode 100644
982648
index 0000000000..d1620d1946
982648
--- /dev/null
982648
+++ b/tests/qemuxml2argvdata/pages-discard-hugepages.xml
982648
@@ -0,0 +1,34 @@
982648
+<domain type='qemu'>
982648
+  <name>SomeDummyHugepagesGuest</name>
982648
+  <uuid>ef1bdff4-27f3-4e85-a807-5fb4d58463cc</uuid>
982648
+  <memory unit='KiB'>1048576</memory>
982648
+  <currentMemory unit='KiB'>1048576</currentMemory>
982648
+  <memoryBacking>
982648
+    <hugepages/>
982648
+  </memoryBacking>
982648
+  <vcpu placement='static'>2</vcpu>
982648
+  <os>
982648
+    <type arch='i686' machine='pc'>hvm</type>
982648
+    <boot dev='hd'/>
982648
+  </os>
982648
+  <cpu>
982648
+    <numa>
982648
+      <cell id='0' cpus='0' memory='262144' unit='KiB' discard='no'/>
982648
+      <cell id='1' cpus='1' memory='786432' unit='KiB' discard='yes'/>
982648
+    </numa>
982648
+  </cpu>
982648
+  <clock offset='utc'/>
982648
+  <on_poweroff>destroy</on_poweroff>
982648
+  <on_reboot>restart</on_reboot>
982648
+  <on_crash>destroy</on_crash>
982648
+  <devices>
982648
+    <emulator>/usr/bin/qemu-system-i686</emulator>
982648
+    <controller type='usb' index='0'>
982648
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
982648
+    </controller>
982648
+    <controller type='pci' index='0' model='pci-root'/>
982648
+    <input type='mouse' bus='ps2'/>
982648
+    <input type='keyboard' bus='ps2'/>
982648
+    <memballoon model='none'/>
982648
+  </devices>
982648
+</domain>
982648
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
982648
index 6a79918f67..a95d2c1915 100644
982648
--- a/tests/qemuxml2argvtest.c
982648
+++ b/tests/qemuxml2argvtest.c
982648
@@ -948,6 +948,10 @@ mymain(void)
982648
     DO_TEST("pages-discard",
982648
             QEMU_CAPS_OBJECT_MEMORY_FILE,
982648
             QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD);
982648
+    DO_TEST("pages-discard-hugepages",
982648
+            QEMU_CAPS_OBJECT_MEMORY_RAM,
982648
+            QEMU_CAPS_OBJECT_MEMORY_FILE,
982648
+            QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD);
982648
     DO_TEST("hugepages-default", NONE);
982648
     DO_TEST("hugepages-numa-default",
982648
             QEMU_CAPS_OBJECT_MEMORY_FILE);
982648
@@ -961,8 +965,7 @@ mymain(void)
982648
             QEMU_CAPS_OBJECT_MEMORY_RAM,
982648
             QEMU_CAPS_OBJECT_MEMORY_FILE);
982648
     DO_TEST("hugepages-pages3", QEMU_CAPS_OBJECT_MEMORY_RAM,
982648
-            QEMU_CAPS_OBJECT_MEMORY_FILE,
982648
-            QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD);
982648
+            QEMU_CAPS_OBJECT_MEMORY_FILE);
982648
     DO_TEST("hugepages-shared",
982648
             QEMU_CAPS_OBJECT_MEMORY_RAM,
982648
             QEMU_CAPS_OBJECT_MEMORY_FILE);
982648
diff --git a/tests/qemuxml2xmloutdata/hugepages-pages3.xml b/tests/qemuxml2xmloutdata/hugepages-pages3.xml
982648
index 90e6efa5ea..be21c3eddd 100644
982648
--- a/tests/qemuxml2xmloutdata/hugepages-pages3.xml
982648
+++ b/tests/qemuxml2xmloutdata/hugepages-pages3.xml
982648
@@ -15,8 +15,8 @@
982648
   </os>
982648
   <cpu>
982648
     <numa>
982648
-      <cell id='0' cpus='0' memory='262144' unit='KiB' discard='no'/>
982648
-      <cell id='1' cpus='1' memory='786432' unit='KiB' discard='yes'/>
982648
+      <cell id='0' cpus='0' memory='262144' unit='KiB'/>
982648
+      <cell id='1' cpus='1' memory='786432' unit='KiB'/>
982648
     </numa>
982648
   </cpu>
982648
   <clock offset='utc'/>
982648
diff --git a/tests/qemuxml2xmloutdata/pages-discard-hugepages.xml b/tests/qemuxml2xmloutdata/pages-discard-hugepages.xml
982648
new file mode 120000
982648
index 0000000000..3d2f0682dc
982648
--- /dev/null
982648
+++ b/tests/qemuxml2xmloutdata/pages-discard-hugepages.xml
982648
@@ -0,0 +1 @@
982648
+../qemuxml2argvdata/pages-discard-hugepages.xml
982648
\ No newline at end of file
982648
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
982648
index a4448ff168..83c0ffdfe2 100644
982648
--- a/tests/qemuxml2xmltest.c
982648
+++ b/tests/qemuxml2xmltest.c
982648
@@ -331,6 +331,7 @@ mymain(void)
982648
     DO_TEST("pmu-feature-off", NONE);
982648
 
982648
     DO_TEST("pages-discard", NONE);
982648
+    DO_TEST("pages-discard-hugepages", NONE);
982648
     DO_TEST("hugepages-default", NONE);
982648
     DO_TEST("hugepages-numa-default-2M", NONE);
982648
     DO_TEST("hugepages-numa-default-dimm", NONE);
982648
-- 
982648
2.18.0
982648