diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index dd8a295f0d..69e0c9e217 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -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;