]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Warn on possibly incorrect usage of EnterMonitor*
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 7 Nov 2019 13:05:43 +0000 (14:05 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 8 Nov 2019 15:25:46 +0000 (16:25 +0100)
The qemuDomainObjEnterMonitor() should not be called without a
job set. Catch this error and produce a warning message if such
call occurred.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
src/qemu/qemu_domain.c

index bda357ceb96543ab292a130b430687f9d4df6cbb..58a82fbd601933715bf61cee540e4652461b5aac 100644 (file)
@@ -8719,6 +8719,11 @@ qemuDomainObjEnterMonitorInternal(virQEMUDriverPtr driver,
     } else if (priv->job.asyncOwner == virThreadSelfID()) {
         VIR_WARN("This thread seems to be the async job owner; entering"
                  " monitor without asking for a nested job is dangerous");
+    } else if (priv->job.owner != virThreadSelfID()) {
+        VIR_WARN("Entering a monitor without owning a job. "
+                 "Job %s owner %s (%llu)",
+                 qemuDomainJobTypeToString(priv->job.active),
+                 priv->job.ownerAPI, priv->job.owner);
     }
 
     VIR_DEBUG("Entering monitor (mon=%p vm=%p name=%s)",