]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Don't ignore virProcessGetMaxMemLock() errors
authorAndrea Bolognani <abologna@redhat.com>
Wed, 3 Mar 2021 11:02:49 +0000 (12:02 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 22 Mar 2021 11:05:18 +0000 (12:05 +0100)
Now that we've implemented a fallback for the function that
obtains the information from /proc, there is no reason we would
get a failure unless there's something seriously wrong with the
environment we're running in, in which case we're better off
reporting the issue to the user rather than pretending
everything is fine.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_domain.c

index 5c98f8ff1aae2e42060adea2dc35bcd3f63280b9..e8477d1f053b176eede164ecde148d8b9ea201d6 100644 (file)
@@ -9350,11 +9350,10 @@ qemuDomainAdjustMaxMemLock(virDomainObjPtr vm,
     if (bytes) {
         /* If this is the first time adjusting the limit, save the current
          * value so that we can restore it once memory locking is no longer
-         * required. Failing to obtain the current limit is not a critical
-         * failure, it just means we'll be unable to lower it later */
+         * required */
         if (!vm->originalMemlock) {
             if (virProcessGetMaxMemLock(vm->pid, &(vm->originalMemlock)) < 0)
-                vm->originalMemlock = 0;
+                return -1;
         }
     } else {
         /* Once memory locking is no longer required, we can restore the