<div dir="ltr">Hi Jirka,<div><br></div><div>Thanks for your answer, but I'm looking for a way to set RLIMIT_MEMLOCK without locking all VM memory.</div><div>I'm wondering if there is a way to set RLIMIT_MEMLOCK without using the methods you wrote above.</div><div><br></div><div>Regards,</div><div>Roy</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 15, 2016 at 8:02 PM, Jiri Denemark <span dir="ltr"><<a href="mailto:jdenemar@redhat.com" target="_blank">jdenemar@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Feb 19, 2016 at 23:37:57 +0200, Roy Shterman wrote:<br>
> Yes,<br>
><br>
> I tried also running it as root user and it also didn't worked.<br>
><br>
> Do you know where libvirt (or QEMU) gets the value for process MEMLOCK?<br>
> maybe i can change this value in libvirt code?<br>
<br>
</span>You can change it by specifying /domain/memtune/hard_limit in domain<br>
XML; see <a href="http://libvirt.org/formatdomain.html#elementsMemoryTuning" rel="noreferrer" target="_blank">http://libvirt.org/formatdomain.html#elementsMemoryTuning</a><br>
<br>
Libvirt will use the hard_limit value for RLIMIT_MEMLOCK, but only if<br>
needed. So it will be set only if any of the following is true:<br>
    - you are on PPC64<br>
    - the /domain/memoryBacking/locked is set<br>
    - a VFIO device passthrough is used<br>
    - an RDMA migration is initiated.<br>
<br>
Jirka<br>
</blockquote></div><br></div>