2015-11-06 13:20:06 +00:00
|
|
|
LC_ALL=C \
|
|
|
|
PATH=/bin \
|
|
|
|
HOME=/home/test \
|
|
|
|
USER=test \
|
|
|
|
LOGNAME=test \
|
|
|
|
QEMU_AUDIO_DRV=none \
|
2017-04-06 16:19:48 +00:00
|
|
|
/usr/bin/qemu-system-i686 \
|
2015-11-06 14:29:41 +00:00
|
|
|
-name QEMUGuest1 \
|
2015-11-06 13:20:06 +00:00
|
|
|
-S \
|
|
|
|
-M pc \
|
|
|
|
-m size=219136k,slots=16,maxmem=1099511627776k \
|
2016-06-23 11:29:16 +00:00
|
|
|
-smp 2,sockets=2,cores=1,threads=1 \
|
2015-03-26 06:30:56 +00:00
|
|
|
-numa node,nodeid=0,cpus=0-1,mem=214 \
|
qemuBuildMemoryBackendStr: Honour passed @pagesize
So far the argument has not much meaning and was practically ignored.
This is not good since when doing memory hotplug, the size of desired
hugepage backing is passed in that argument. Taking closer look at the
tests I'm fixing reveals the bug. For instance, while the following is
in the test:
<memory model='dimm'>
<source>
<nodemask>1-3</nodemask>
<pagesize unit='KiB'>4096</pagesize>
</source>
<target>
<size unit='KiB'>524287</size>
<node>0</node>
</target>
<address type='dimm' slot='0' base='0x100000000'/>
</memory>
the generated commandline corresponding to this XML was:
-object memory-backend-ram,id=memdimm0,size=536870912,\
host-nodes=1-3,policy=bind
Have you noticed? Yes, memory-backend-ram! Nothing can be further away
from the right answer. The hugepage backing is requested in the XML
and we happily ignore it. This is just not right. It's
memory-backend-file which should have been used:
-object memory-backend-file,id=memdimm0,prealloc=yes,\
mem-path=/dev/hugepages4M/libvirt/qemu,size=536870912,\
host-nodes=1-3,policy=bind
The problem is, that @pagesize passed to qemuBuildMemoryBackendStr
(where this part of commandline is built) was ignored. The hugepage to
back memory was searched only and only by NUMA nodes pinning. This
works only for regular guest NUMA nodes.
Then, I'm changing the hugepages size in the test XMLs too. This is
simply because in the test suite we create dummy mount points just for
2M and 1G hugepages. And in the test 4M was requested. I'm sticking to
2M, but 1G should just work too.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-06-25 15:27:29 +00:00
|
|
|
-object memory-backend-file,id=memdimm0,prealloc=yes,\
|
2016-11-22 12:21:51 +00:00
|
|
|
mem-path=/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1,size=536870912,\
|
|
|
|
host-nodes=1-3,policy=bind \
|
2015-03-26 06:30:56 +00:00
|
|
|
-device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0,addr=4294967296 \
|
2016-11-01 05:21:36 +00:00
|
|
|
-object memory-backend-ram,id=memdimm2,size=536870912 \
|
|
|
|
-device pc-dimm,node=0,memdev=memdimm2,id=dimm2,slot=2 \
|
2015-11-06 14:29:52 +00:00
|
|
|
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
2015-11-06 13:20:06 +00:00
|
|
|
-nographic \
|
|
|
|
-nodefaults \
|
2017-06-26 14:40:39 +00:00
|
|
|
-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
|
|
|
|
server,nowait \
|
|
|
|
-mon chardev=charmonitor,id=monitor,mode=readline \
|
2015-11-06 13:20:06 +00:00
|
|
|
-no-acpi \
|
|
|
|
-boot c \
|
|
|
|
-usb \
|
2015-12-28 14:13:52 +00:00
|
|
|
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
|
2015-11-06 14:28:57 +00:00
|
|
|
-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
|
2015-03-26 06:30:56 +00:00
|
|
|
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
|