On Thu, Jul 11, 2024 at 14:55:17 +0200, Jiri Denemark wrote:
> Recent commit v10.4.0-87-gd9935a5c4f made a reasonable change to only
> reset beingDestroyed back to false when vm->def->id is reset to make
> sure other code can detect a domain is (about to become) inactive. It
> even added a comment saying any caller of qemuProcessBeginStopJob is
> supposed to call qemuProcessStop to clear beingDestroyed. But not every
> caller really does so because they first call qemuProcessBeginStopJob
> and then check whether a domain is still running. If not the
> qemuProcessStop call is skipped leaving beingDestroyed=true. In case of
> a persistent domain this may block incoming migrations of such domain as
> the migration code would think the domain died unexpectedly (even though
> it's still running).
> 
> The qemuProcessBeginStopJob function is a wrapper around
> virDomainObjBeginJob, but virDomainObjEndJob was used directly for
> cleanup. This patch introduces a new qemuProcessEndStopJob wrapper
> around virDomainObjEndJob to properly undo everything
> qemuProcessBeginStopJob did.
> 
> https://issues.redhat.com/browse/RHEL-43309
> 
> Signed-off-by: Jiri Denemark <[email protected]>
> ---
>  src/qemu/qemu_driver.c  |  4 ++--
>  src/qemu/qemu_process.c | 20 ++++++++++++++++----
>  src/qemu/qemu_process.h |  1 +
>  3 files changed, 19 insertions(+), 6 deletions(-)

For consistency you should also fix qemuProcessAutoDestroy which uses
qemuProcessBeginStopJob even when it doesn't jump out before calling
qemuProcessStop.

Reviewed-by: Peter Krempa <[email protected]>

Reply via email to