render / rpms / libvirt

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