mirror of https://gitee.com/openkylin/libvirt.git
qemu: Do not try to set memlock on inactive domain
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@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
f931079e89
commit
fc8538157b
|
@ -9405,6 +9405,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, ¤t) < 0)
|
||||
return -1;
|
||||
|
||||
|
|
Loading…
Reference in New Issue