]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuDomainObjBeginJobInternal: Log agent job too
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 20 Jun 2018 12:15:42 +0000 (14:15 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 25 Jun 2018 05:28:53 +0000 (07:28 +0200)
If a thread is unable to start a job (e.g. because of timeout)
a warning is printed into the logs. So far, the message does not
contain agent job info. Add it as it might help future debugging.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_domain.c

index c136ed7f46059e752ed3022bbe0b1f660cfa98c6..95c3e3a8aab87ed51b20bbce54f0e7f90985b929 100644 (file)
@@ -6422,6 +6422,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver,
     const char *blocker = NULL;
     int ret = -1;
     unsigned long long duration = 0;
+    unsigned long long agentDuration = 0;
     unsigned long long asyncDuration = 0;
 
     VIR_DEBUG("Starting job: job=%s agentJob=%s asyncJob=%s "
@@ -6526,22 +6527,27 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver,
     ignore_value(virTimeMillisNow(&now));
     if (priv->job.active && priv->job.started)
         duration = now - priv->job.started;
+    if (priv->job.agentActive && priv->job.agentStarted)
+        agentDuration = now - priv->job.agentStarted;
     if (priv->job.asyncJob && priv->job.asyncStarted)
         asyncDuration = now - priv->job.asyncStarted;
 
-    VIR_WARN("Cannot start job (%s, %s) for domain %s; "
-             "current job is (%s, %s) "
-             "owned by (%llu %s, %llu %s (flags=0x%lx)) "
-             "for (%llus, %llus)",
+    VIR_WARN("Cannot start job (%s, %s, %s) for domain %s; "
+             "current job is (%s, %s, %s) "
+             "owned by (%llu %s, %llu %s, %llu %s (flags=0x%lx)) "
+             "for (%llus, %llus, %llus)",
              qemuDomainJobTypeToString(job),
+             qemuDomainAgentJobTypeToString(agentJob),
              qemuDomainAsyncJobTypeToString(asyncJob),
              obj->def->name,
              qemuDomainJobTypeToString(priv->job.active),
+             qemuDomainAgentJobTypeToString(priv->job.agentActive),
              qemuDomainAsyncJobTypeToString(priv->job.asyncJob),
              priv->job.owner, NULLSTR(priv->job.ownerAPI),
+             priv->job.agentOwner, NULLSTR(priv->job.agentOwnerAPI),
              priv->job.asyncOwner, NULLSTR(priv->job.asyncOwnerAPI),
              priv->job.apiFlags,
-             duration / 1000, asyncDuration / 1000);
+             duration / 1000, agentDuration / 1000, asyncDuration / 1000);
 
     if (nested || qemuDomainNestedJobAllowed(priv, job))
         blocker = priv->job.ownerAPI;