From: Michal Privoznik Date: Thu, 7 Nov 2019 13:05:43 +0000 (+0100) Subject: qemu: Warn on possibly incorrect usage of EnterMonitor* X-Git-Tag: v5.10.0-rc1~386 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1faf74050f0d16f6c41686b76fea48754cdd88e8;p=thirdparty%2Flibvirt.git qemu: Warn on possibly incorrect usage of EnterMonitor* 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 Reviewed-by: Jonathon Jongsma --- diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index bda357ceb9..58a82fbd60 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -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)",