mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
tests: extract pages-discard out of hugepages-pages
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 <phrdina@redhat.com>
This commit is contained in:
parent
335c4a5e26
commit
aa6a5e0995
@ -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 \
|
||||
|
@ -8,7 +8,6 @@
|
||||
<page size='2048' unit='KiB' nodeset='1'/>
|
||||
<page size='1048576' unit='KiB' nodeset='0,2-3'/>
|
||||
</hugepages>
|
||||
<discard/>
|
||||
</memoryBacking>
|
||||
<vcpu placement='static'>4</vcpu>
|
||||
<numatune>
|
||||
@ -22,7 +21,7 @@
|
||||
<cpu>
|
||||
<numa>
|
||||
<cell id='0' cpus='0' memory='1048576' unit='KiB'/>
|
||||
<cell id='1' cpus='1' memory='1048576' unit='KiB' discard='no'/>
|
||||
<cell id='1' cpus='1' memory='1048576' unit='KiB'/>
|
||||
<cell id='2' cpus='2' memory='1048576' unit='KiB'/>
|
||||
<cell id='3' cpus='3' memory='1048576' unit='KiB'/>
|
||||
</numa>
|
||||
|
27
tests/qemuxml2argvdata/pages-discard.args
Normal file
27
tests/qemuxml2argvdata/pages-discard.args
Normal file
@ -0,0 +1,27 @@
|
||||
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 \
|
||||
-usb
|
36
tests/qemuxml2argvdata/pages-discard.xml
Normal file
36
tests/qemuxml2argvdata/pages-discard.xml
Normal file
@ -0,0 +1,36 @@
|
||||
<domain type='qemu'>
|
||||
<name>QEMUGuest1</name>
|
||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory unit='KiB'>4194304</memory>
|
||||
<currentMemory unit='KiB'>4194304</currentMemory>
|
||||
<memoryBacking>
|
||||
<discard/>
|
||||
</memoryBacking>
|
||||
<vcpu placement='static'>4</vcpu>
|
||||
<os>
|
||||
<type arch='i686' machine='pc'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<cpu>
|
||||
<numa>
|
||||
<cell id='0' cpus='0' memory='1048576' unit='KiB'/>
|
||||
<cell id='1' cpus='1' memory='1048576' unit='KiB' discard='no'/>
|
||||
<cell id='2' cpus='2' memory='1048576' unit='KiB'/>
|
||||
<cell id='3' cpus='3' memory='1048576' unit='KiB'/>
|
||||
</numa>
|
||||
</cpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu-system-i686</emulator>
|
||||
<controller type='usb' index='0'>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
||||
</controller>
|
||||
<controller type='pci' index='0' model='pci-root'/>
|
||||
<input type='mouse' bus='ps2'/>
|
||||
<input type='keyboard' bus='ps2'/>
|
||||
<memballoon model='none'/>
|
||||
</devices>
|
||||
</domain>
|
@ -944,6 +944,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);
|
||||
@ -952,8 +955,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,
|
||||
|
@ -8,7 +8,6 @@
|
||||
<page size='2048' unit='KiB' nodeset='1'/>
|
||||
<page size='1048576' unit='KiB' nodeset='0,2-3'/>
|
||||
</hugepages>
|
||||
<discard/>
|
||||
</memoryBacking>
|
||||
<vcpu placement='static'>4</vcpu>
|
||||
<numatune>
|
||||
@ -22,7 +21,7 @@
|
||||
<cpu>
|
||||
<numa>
|
||||
<cell id='0' cpus='0' memory='1048576' unit='KiB'/>
|
||||
<cell id='1' cpus='1' memory='1048576' unit='KiB' discard='no'/>
|
||||
<cell id='1' cpus='1' memory='1048576' unit='KiB'/>
|
||||
<cell id='2' cpus='2' memory='1048576' unit='KiB'/>
|
||||
<cell id='3' cpus='3' memory='1048576' unit='KiB'/>
|
||||
</numa>
|
||||
|
1
tests/qemuxml2xmloutdata/pages-discard.xml
Symbolic link
1
tests/qemuxml2xmloutdata/pages-discard.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../qemuxml2argvdata/pages-discard.xml
|
@ -325,6 +325,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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user