[libvirt PATCH] qemu: Do not try to set memlock on inactive domain

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When we call qemuDomainSetMaxMemLock to reset memory locking limit back
to its original value the domain can already be stopped (for example
after the domain shuts down during migration) in which case it does not
make sense to set any limit. Doing so can even be harmful as we may end
up setting the limit for the daemon itself as the PID is 0.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 12c58a25b9..ad6c614d89 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -9461,6 +9461,10 @@ qemuDomainSetMaxMemLock(virDomainObj *vm,
 {
     unsigned long long current = 0;
 
+    /* nothing to do if the domain is not running */
+    if (vm->pid <= 0)
+        return 0;
+
     if (virProcessGetMaxMemLock(vm->pid, &current) < 0)
         return -1;
 
-- 
2.35.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux