mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
qemu: Warn on possibly incorrect usage of EnterMonitor*
qemuDomainObjEnterMonitor{,WithDriver} should not be called from async jobs, only EnterMonitorAsync variant is allowed.
This commit is contained in:
parent
08ec1d787f
commit
6eede368bc
@ -975,6 +975,9 @@ qemuDomainObjEnterMonitorInternal(struct qemud_driver *driver,
|
||||
_("unexpected async job %d"), asyncJob);
|
||||
return -1;
|
||||
}
|
||||
if (priv->job.asyncOwner != virThreadSelfID())
|
||||
VIR_WARN("This thread doesn't seem to be the async job owner: %d",
|
||||
priv->job.asyncOwner);
|
||||
if (qemuDomainObjBeginJobInternal(driver, driver_locked, obj,
|
||||
QEMU_JOB_ASYNC_NESTED,
|
||||
QEMU_ASYNC_JOB_NONE) < 0)
|
||||
@ -986,6 +989,9 @@ qemuDomainObjEnterMonitorInternal(struct qemud_driver *driver,
|
||||
ignore_value(qemuDomainObjEndJob(driver, obj));
|
||||
return -1;
|
||||
}
|
||||
} 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");
|
||||
}
|
||||
|
||||
qemuMonitorLock(priv->mon);
|
||||
|
Loading…
x
Reference in New Issue
Block a user