提交 af32e57f 编写于 作者: J Jiri Denemark

qemu: Don't misuse "ret" in qemuMigrationRun

The "ret" variable is used for storing the return value of a function
and should not be used as a temporary variable.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 7d2fbabc
...@@ -3793,16 +3793,17 @@ qemuMigrationRun(virQEMUDriverPtr driver, ...@@ -3793,16 +3793,17 @@ qemuMigrationRun(virQEMUDriverPtr driver,
VIR_FREE(timestamp); VIR_FREE(timestamp);
} }
rc = -1;
switch (spec->destType) { switch (spec->destType) {
case MIGRATION_DEST_HOST: case MIGRATION_DEST_HOST:
if (STREQ(spec->dest.host.protocol, "rdma") && if (STREQ(spec->dest.host.protocol, "rdma") &&
virProcessSetMaxMemLock(vm->pid, vm->def->mem.hard_limit << 10) < 0) { virProcessSetMaxMemLock(vm->pid, vm->def->mem.hard_limit << 10) < 0) {
goto exit_monitor; goto exit_monitor;
} }
ret = qemuMonitorMigrateToHost(priv->mon, migrate_flags, rc = qemuMonitorMigrateToHost(priv->mon, migrate_flags,
spec->dest.host.protocol, spec->dest.host.protocol,
spec->dest.host.name, spec->dest.host.name,
spec->dest.host.port); spec->dest.host.port);
break; break;
case MIGRATION_DEST_CONNECT_HOST: case MIGRATION_DEST_CONNECT_HOST:
...@@ -3814,16 +3815,14 @@ qemuMigrationRun(virQEMUDriverPtr driver, ...@@ -3814,16 +3815,14 @@ qemuMigrationRun(virQEMUDriverPtr driver,
fd = spec->dest.fd.local; fd = spec->dest.fd.local;
spec->dest.fd.local = -1; spec->dest.fd.local = -1;
} }
ret = qemuMonitorMigrateToFd(priv->mon, migrate_flags, rc = qemuMonitorMigrateToFd(priv->mon, migrate_flags,
spec->dest.fd.qemu); spec->dest.fd.qemu);
VIR_FORCE_CLOSE(spec->dest.fd.qemu); VIR_FORCE_CLOSE(spec->dest.fd.qemu);
break; break;
} }
if (qemuDomainObjExitMonitor(driver, vm) < 0)
ret = -1; if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
if (ret < 0)
goto error; goto error;
ret = -1;
/* From this point onwards we *must* call cancel to abort the /* From this point onwards we *must* call cancel to abort the
* migration on source if anything goes wrong */ * migration on source if anything goes wrong */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册