From: Jiri Denemark Date: Fri, 19 Mar 2021 21:42:25 +0000 (+0100) Subject: qemu: Update asyncOwnerAPI when entering async job phase X-Git-Tag: v7.2.0-rc1~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df92ccb494b17dd400a91250c59613e1a88ba2c6;p=thirdparty%2Flibvirt.git qemu: Update asyncOwnerAPI when entering async job phase In case an async job spans multiple APIs (e.g., incoming migration) the API that started the job is recorded as the asyncOwnerAPI even though it is no longer running and the owner thread is updated properly to the one currently handling the job. Let's also update asyncOwnerAPI to make it more obvious which is the current (or the most recent) API involved in the job. Signed-off-by: Jiri Denemark Reviewed-by: Erik Skultety --- diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c index b58d6837ad..50cfc45f5b 100644 --- a/src/qemu/qemu_domainjob.c +++ b/src/qemu/qemu_domainjob.c @@ -711,7 +711,9 @@ qemuDomainObjSetJobPhase(virQEMUDriverPtr driver, qemuDomainAsyncJobTypeToString(priv->job.asyncJob), qemuDomainAsyncJobPhaseToString(priv->job.asyncJob, phase)); - if (priv->job.asyncOwner && me != priv->job.asyncOwner) { + if (priv->job.asyncOwner == 0) { + priv->job.asyncOwnerAPI = g_strdup(virThreadJobGet()); + } else if (me != priv->job.asyncOwner) { VIR_WARN("'%s' async job is owned by thread %llu", qemuDomainAsyncJobTypeToString(priv->job.asyncJob), priv->job.asyncOwner);