提交 78107f85 编写于 作者: N Nikolay Shirokovskiy 提交者: Jiri Denemark

qemu: fail querying destination migration statistics always

Querying destination migration statistics may result in getting
a failure or getting a elapsed time value depending on stats.status
value which is odd. Instead let's always fail. Clients should
be ready to handle this as currently getting failure period
can be considerable.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 c9cd4b4a
......@@ -12987,20 +12987,19 @@ qemuDomainGetJobStatsInternal(virQEMUDriverPtr driver,
return 0;
}
if (priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_IN) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("migration statistics are available only on "
"the source host"));
return -1;
}
/* Do not ask QEMU if migration is not even running yet */
if (!priv->job.current || !priv->job.current->stats.status)
fetch = false;
if (fetch) {
if (priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_IN) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("migration statistics are available only on "
"the source host"));
return -1;
}
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0)
return -1;
}
if (fetch && qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0)
return -1;
if (!virDomainObjIsActive(vm)) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册