mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-06 13:20:20 +00:00
2c4affd57e
https://bugzilla.redhat.com/show_bug.cgi?id=1480668 QEMU has this new feature memory-backend-file.discard-data=yes which is a nifty optimization. Basically, when qemu is quitting or on memory hotplug it calls munmap() and close() on the file that is backing the memory. However, this does not mean kernel won't stop touching that part of memory. It still might. With this feature enabled we tell kernel: "we don't need this memory nor data stored in it". This makes kernel drop the memory immediately without trying to sync memory with the mapped file. Unfortunately, this cannot be turned on by default because we can't be sure when users really don't care about what happens to data after qemu dies. So it has to be opt-in. As usual, there are three places where one can configure memory attributes. This patch adds the feature to all of them. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
34 lines
1.0 KiB
Plaintext
34 lines
1.0 KiB
Plaintext
LC_ALL=C \
|
|
PATH=/bin \
|
|
HOME=/home/test \
|
|
USER=test \
|
|
LOGNAME=test \
|
|
QEMU_AUDIO_DRV=none \
|
|
/usr/bin/qemu-system-i686 \
|
|
-name SomeDummyHugepagesGuest \
|
|
-S \
|
|
-machine pc,accel=tcg,usb=off,dump-guest-core=off \
|
|
-m 1024 \
|
|
-smp 2,sockets=2,cores=1,threads=1 \
|
|
-object memory-backend-ram,id=ram-node0,size=268435456 \
|
|
-numa node,nodeid=0,cpus=0,memdev=ram-node0 \
|
|
-object memory-backend-file,id=ram-node1,prealloc=yes,\
|
|
mem-path=/dev/hugepages1G/libvirt/qemu/-1-SomeDummyHugepagesGu,\
|
|
discard-data=yes,size=805306368 \
|
|
-numa node,nodeid=1,cpus=1,memdev=ram-node1 \
|
|
-uuid ef1bdff4-27f3-4e85-a807-5fb4d58463cc \
|
|
-display none \
|
|
-no-user-config \
|
|
-nodefaults \
|
|
-chardev socket,id=charmonitor,\
|
|
path=/tmp/lib/domain--1-SomeDummyHugepagesGu/monitor.sock,server,nowait \
|
|
-mon chardev=charmonitor,id=monitor,mode=control \
|
|
-rtc base=utc \
|
|
-no-shutdown \
|
|
-no-acpi \
|
|
-boot c \
|
|
-usb \
|
|
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
|
|
-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
|
|
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
|