diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 828ae307898b0555fde65c7fa326cb5ef589399c..2ad73959ec26617ba44138e52d188f0d822d6bc4 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -10785,13 +10785,14 @@ doMigrate(void *opaque) goto save_error; } - if (vshCommandOptInt(ctl, cmd, "parallel-connections", &intOpt) < 0) + if ((rv = vshCommandOptInt(ctl, cmd, "parallel-connections", &intOpt)) < 0) { goto out; - if (intOpt && - virTypedParamsAddInt(¶ms, &nparams, &maxparams, - VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS, - intOpt) < 0) - goto save_error; + } else if (rv > 0) { + if (virTypedParamsAddInt(¶ms, &nparams, &maxparams, + VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS, + intOpt) < 0) + goto save_error; + } if (vshCommandOptBool(cmd, "live")) flags |= VIR_MIGRATE_LIVE;