From: Michal Privoznik Date: Mon, 5 Mar 2018 09:13:29 +0000 (+0100) Subject: qemuDomainObjBeginJob: Don't account DESTROY job to maxQueuedJobs X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c17666419b3579c9c73b5a49027eaeb999a85689;p=libvirt.git qemuDomainObjBeginJob: Don't account DESTROY job to maxQueuedJobs When trying to destroy a domain (e.g. because we've seen EOF on the monitor) we try to acquire QEMU_JOB_DESTROY. However, if max_queued is set in qemu.conf this may fail and since our code doesn't count on that we will still report domain as active even though the qemu process is long gone. More specifically, if we've seen EOF on the monitor, qemuProcessHandleMonitorEOF() is called which sends MONITOR_EOF job to the event worker pool and unregisters monitor from the event loop. The worker pool calls processMonitorEOFEvent() which tries to set job which may fail due to the limit as described above. Signed-off-by: Michal Privoznik --- diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 8b4efc82de..ee02ecd0cd 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5401,7 +5401,8 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver, then = now + QEMU_JOB_WAIT_TIME; retry: - if (cfg->maxQueuedJobs && + if ((!async && job != QEMU_JOB_DESTROY) && + cfg->maxQueuedJobs && priv->jobs_queued > cfg->maxQueuedJobs) { goto error; }