On 9/15/20 11:53 AM, Igor Mammedov wrote:
On Tue, 15 Sep 2020 10:54:46 +0200 Michal Privoznik <mprivozn redhat com> wrote:On 9/8/20 3:55 PM, Ján Tomko wrote:On a Tuesday in 2020, Michal Privoznik wrote:diff --git a/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-latest.args b/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-latest.args index 5d256c42bc..b43e7d9c3c 100644 --- a/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-latest.args +++ b/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-latest.args @@ -12,14 +12,16 @@ QEMU_AUDIO_DRV=none \ -S \ -object secret,id=masterKey0,format=raw,\ file=/tmp/lib/domain--1-instance-00000092/master-key.aes \ --machine pc-i440fx-2.3,accel=kvm,usb=off,dump-guest-core=off \ +-machine pc-i440fx-2.3,accel=kvm,usb=off,dump-guest-core=off,\ +memory-backend=pc.ram \ -cpu qemu64 \ -m 14336 \ --mem-prealloc \ +-object memory-backend-memfd,id=pc.ram,hugetlb=yes,hugetlbsize=2097152,\ +share=yes,prealloc=yes,size=15032385536 \ -overcommit mem-lock=off \ -smp 8,sockets=1,dies=1,cores=8,threads=1 \ -object memory-backend-memfd,id=ram-node0,hugetlb=yes,hugetlbsize=2097152,\ -share=yes,size=15032385536,host-nodes=3,policy=preferred \ +share=yes,prealloc=yes,size=15032385536,host-nodes=3,policy=preferred \ -numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \ -uuid 126f2720-6f8e-45ab-a886-ec9277079a67 \ -display none \Should we format all the fields twice in these cases?Ah, good question. Honestly, I don't remember, it was slightly longer ago that I've written these patches. Igor, do you perhaps remember whether libvirt needs to specify both: -machine memory-backend=$id and -object memory-backend-*,id=$id?the later defines backend and the former uses it, short answer is yes.
Ah, good point. That's the thing I didn't remember.
you do not need --mem-prealloc if you explicitly set "prealloc=yes" on backend.
Yes, we are not doing this for quite some time now. https://gitlab.com/libvirt/libvirt/-/commit/c658764decf357ef2a064f09235fb6b8bd027f8b
I'd prefer if libvirt stopped using old -mem-prealloc and -mem-path in favor of explicit properties on backend, so QEMU could deprecate it and drop aliasing code which uses global properties hack.
That is the whole intent of this series. The only problem was that we couldn't just switch to memory-backend-* because that was incompatible with -mem-path + -m. And the discussion led us to this solution.