提交 88ce7bac 编写于 作者: J Jiri Denemark

virsh migrate: Properly check for --parallel-connections

Ever since --parallel-connections option for virsh migrate was
introduced we did not properly check the return value of
vshCommandOptInt. We would set VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS
parameter even if vshCommandOptInt returned 0 (which means
--parallel-connections was not specified) when another int option which
was checked earlier was specified with a nonzero value.

Specifically, running virsh migrate with either
--auto-converge-increment, --auto-converge-initial, --comp-mt-dthreads,
--comp-mt-threads, or --comp-mt-level would set
VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS parameter and if --parallel
option was not used, libvirt would complain

    error: invalid argument: Turn parallel migration on to tune it

even though --parallel-connections option was not used at all.

https://bugzilla.redhat.com/show_bug.cgi?id=1726643Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 2651b04b
...@@ -10785,13 +10785,14 @@ doMigrate(void *opaque) ...@@ -10785,13 +10785,14 @@ doMigrate(void *opaque)
goto save_error; goto save_error;
} }
if (vshCommandOptInt(ctl, cmd, "parallel-connections", &intOpt) < 0) if ((rv = vshCommandOptInt(ctl, cmd, "parallel-connections", &intOpt)) < 0) {
goto out; goto out;
if (intOpt && } else if (rv > 0) {
virTypedParamsAddInt(&params, &nparams, &maxparams, if (virTypedParamsAddInt(&params, &nparams, &maxparams,
VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS, VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS,
intOpt) < 0) intOpt) < 0)
goto save_error; goto save_error;
}
if (vshCommandOptBool(cmd, "live")) if (vshCommandOptBool(cmd, "live"))
flags |= VIR_MIGRATE_LIVE; flags |= VIR_MIGRATE_LIVE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册