]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Update asyncOwnerAPI when entering async job phase
authorJiri Denemark <jdenemar@redhat.com>
Fri, 19 Mar 2021 21:42:25 +0000 (22:42 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 22 Mar 2021 11:44:18 +0000 (12:44 +0100)
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 <jdenemar@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
src/qemu/qemu_domainjob.c

index b58d6837ad8cc6f6c17f66458f3beb8c2d4f73f0..50cfc45f5bef341f7263334831d1a9256eef86a6 100644 (file)
@@ -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);