提交 d2954c07 编写于 作者: D Daniel P. Berrangé

qemu: ensure domain event thread is always stopped

In previous commit:

  commit e6afacb0
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Wed Feb 12 12:26:11 2020 +0000

    qemu: start/stop an event loop thread for domains

A bogus comment was added claiming we didn't need to shutdown the
event thread in the qemuProcessStop method, because this would be
done in the monitor EOF callback. This was wrong because the EOF
callback only runs in the case of a QEMU crash or a guest initiated
clean shutdown & poweroff.  In the case where the libvirt admin
calls virDomainDestroy, the EOF callback never fires because we
have already unregistered the event callbacks. We must thus always
attempt to stop the event thread in qemuProcessStop.
Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
Reported-by: NPeter Krempa <pkrempa@redhat.com>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 544ef82d
......@@ -7393,17 +7393,7 @@ void qemuProcessStop(virQEMUDriverPtr driver,
priv->monConfig = NULL;
}
/*
* We cannot stop the event thread at this time. When
* we are in this code, we may not yet have processed the
* STOP event or EOF from the monitor. So the event loop
* may have pending input that we need to process still.
* The qemuProcessHandleMonitorEOF method will kill
* the event thread because at that point we don't
* expect any more I/O from the QEMU monitor. We are
* assuming we don't need to get any more events from the
* QEMU agent at that time.
*/
qemuDomainObjStopWorker(vm);
/* Remove the master key */
qemuDomainMasterKeyRemove(priv);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册