diff -Nru libvirt-2.5.0/debian/changelog libvirt-2.5.0/debian/changelog --- libvirt-2.5.0/debian/changelog 2017-07-20 07:06:15.000000000 -0400 +++ libvirt-2.5.0/debian/changelog 2017-08-11 00:34:45.000000000 -0400 @@ -1,3 +1,11 @@ +libvirt (2.5.0-3ubuntu5.5) zesty; urgency=medium + + * d/p/bug-1708305-qemu-Fix-memory-locking-limit-calculation.patch: + Remove memlock limit when using . + (LP: #1708305). + + -- Jorge Niedbalski Fri, 11 Aug 2017 00:34:01 -0400 + libvirt (2.5.0-3ubuntu5.4) zesty; urgency=medium * d/p/ubuntu/bug-1705132-* qemu: Adaptive timeout for connecting to diff -Nru libvirt-2.5.0/debian/patches/series libvirt-2.5.0/debian/patches/series --- libvirt-2.5.0/debian/patches/series 2017-07-20 06:59:14.000000000 -0400 +++ libvirt-2.5.0/debian/patches/series 2017-08-11 00:33:47.000000000 -0400 @@ -67,3 +67,4 @@ ubuntu/qemu_process-spice-don-t-release-used-port.patch ubuntu/bug-1705132-virTimeBackOffWait-Avoid-long-periods-of-sleep.patch ubuntu/bug-1705132-qemu-Adaptive-timeout-for-connecting-to-monitor.patch +ubuntu/bug-1708305-qemu-Fix-memory-locking-limit-calculation.patch diff -Nru libvirt-2.5.0/debian/patches/ubuntu/bug-1708305-qemu-Fix-memory-locking-limit-calculation.patch libvirt-2.5.0/debian/patches/ubuntu/bug-1708305-qemu-Fix-memory-locking-limit-calculation.patch --- libvirt-2.5.0/debian/patches/ubuntu/bug-1708305-qemu-Fix-memory-locking-limit-calculation.patch 1969-12-31 21:00:00.000000000 -0300 +++ libvirt-2.5.0/debian/patches/ubuntu/bug-1708305-qemu-Fix-memory-locking-limit-calculation.patch 2017-08-11 00:33:32.000000000 -0400 @@ -0,0 +1,32 @@ +From 7e667664d28f90bf6916604a55ebad7e2d85305b Mon Sep 17 00:00:00 2001 +From: Andrea Bolognani +Date: Wed, 22 Mar 2017 13:44:13 +0100 +Subject: [PATCH] qemu: Fix memory locking limit calculation + +For guests that use , our only option +is to remove the memory locking limit altogether. + +Partially-resolves: https://bugzilla.redhat.com/1431793 + +Forwarded: no (backport) +Author: Jorge Niedbalski +Original-Author: Andrea Bolognani +Origin: https://libvirt.org/git/?p=libvirt.git;a=patch;h=7e667664d28f90bf6916604a55ebad7e2d85305b +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1708305 +--- libvirt-1.3.1.orig/src/qemu/qemu_domain.c ++++ libvirt-1.3.1/src/qemu/qemu_domain.c +@@ -4095,6 +4095,14 @@ qemuDomainGetMemLockLimitBytes(virDomain + goto done; + } + ++ /* If the guest wants its memory to be locked, we need to raise the memory ++ * locking limit so that the OS will not refuse allocation requests; ++ * however, there is no reliable way for us to figure out how much memory ++ * the QEMU process will allocate for its own use, so our only way out is ++ * to remove the limit altogether. Use with extreme care */ ++ if (def->mem.locked) ++ return VIR_DOMAIN_MEMORY_PARAM_UNLIMITED; ++ + if (ARCH_IS_PPC64(def->os.arch)) { + unsigned long long maxMemory; + unsigned long long memory;