root@buneary:/home/ubuntu# virsh start reproducer2
error: Failed to start domain reproducer2
error: internal error: process exited while connecting to monitor: mlockall: Cannot allocate memory
2017-08-11T03:59:54.936275Z qemu-system-x86_64: locking memory failed
With the patch the guest is initialized correctly.
root@buneary:/var/lib/uvtool/libvirt/images# virsh start reproducer2
Domain reproducer2 started
I ran the following systemtap probe (probe kernel.function("sys_setrlimit") { printf("locked: %d -> %s\n", pid(), sprintf("%s, %s", _rlimit_resource_str($resource), _struct_rlimit_u($rlim))) } )
And the output shows that the RLIMIT_MEMLOCK process limit is set to 9007199254740991 (VIR_DOMAIN_MEMORY_PARAM_UNLIMITED)
root@buneary:/home/ubuntu# stap -g qemu_probe.stap -kv -g --suppress-time-limits
Pass 1: parsed user script and 465 library scripts using 112796virt/48440res/6664shr/42136data kb, in 130usr/40sys/164real ms.
Pass 2: analyzed script: 1 probe, 5 functions, 100 embeds, 0 globals using 164772virt/101848res/7988shr/94112data kb, in 660usr/120sys/776real ms.
Pass 3: translated to C into "/tmp/stapVXuoMi/stap_30601_src.c" using 164772virt/102040res/8180shr/94112data kb, in 10usr/0sys/5real ms.
Pass 4: compiled C into "stap_30601.ko" in 2160usr/540sys/3231real ms.
Pass 5: starting run.
locked: 31028 -> RLIMIT_MEMLOCK, [9007199254740991,9007199254740991]
Hello Christian,
Attached you can find a xenial SRU patch based on commit (https:/ /github. com/libvirt/ libvirt/ commit/ 7e667664d28f90b f6916604a55ebad 7e2d85305b).
Here is the guest definition used on my testing (http:// paste.ubuntu. com/25288141/)
Without the patch, the error is reproduced.
root@buneary: /home/ubuntu# virsh start reproducer2 11T03:59: 54.936275Z qemu-system-x86_64: locking memory failed
error: Failed to start domain reproducer2
error: internal error: process exited while connecting to monitor: mlockall: Cannot allocate memory
2017-08-
With the patch the guest is initialized correctly.
root@buneary: /var/lib/ uvtool/ libvirt/ images# virsh start reproducer2
Domain reproducer2 started
I ran the following systemtap probe (probe kernel. function( "sys_setrlimit" ) { printf("locked: %d -> %s\n", pid(), sprintf("%s, %s", _rlimit_ resource_ str($resource) , _struct_ rlimit_ u($rlim) )) } )
And the output shows that the RLIMIT_MEMLOCK process limit is set to 9007199254740991 (VIR_DOMAIN_ MEMORY_ PARAM_UNLIMITED )
root@buneary: /home/ubuntu# stap -g qemu_probe.stap -kv -g --suppress- time-limits 48440res/ 6664shr/ 42136data kb, in 130usr/ 40sys/164real ms. 101848res/ 7988shr/ 94112data kb, in 660usr/ 120sys/ 776real ms. i/stap_ 30601_src. c" using 164772virt/ 102040res/ 8180shr/ 94112data kb, in 10usr/0sys/5real ms. 540sys/ 3231real ms. 91,900719925474 0991]
Pass 1: parsed user script and 465 library scripts using 112796virt/
Pass 2: analyzed script: 1 probe, 5 functions, 100 embeds, 0 globals using 164772virt/
Pass 3: translated to C into "/tmp/stapVXuoM
Pass 4: compiled C into "stap_30601.ko" in 2160usr/
Pass 5: starting run.
locked: 31028 -> RLIMIT_MEMLOCK, [90071992547409