提交 93df3a97 编写于 作者: J Jiri Denemark

qemu: Rename ret variable in qemuProcessStart

Generally, we use "ret" variable for storing the value we are going to
return at the and of a function, but this is not the case in
qemuProcessStart. Let's rename "ret" as "rv".
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 7404c405
...@@ -4365,7 +4365,7 @@ int qemuProcessStart(virConnectPtr conn, ...@@ -4365,7 +4365,7 @@ int qemuProcessStart(virConnectPtr conn,
virNetDevVPortProfileOp vmop, virNetDevVPortProfileOp vmop,
unsigned int flags) unsigned int flags)
{ {
int ret; int rv;
off_t pos = -1; off_t pos = -1;
char ebuf[1024]; char ebuf[1024];
int logfile = -1; int logfile = -1;
...@@ -4846,15 +4846,15 @@ int qemuProcessStart(virConnectPtr conn, ...@@ -4846,15 +4846,15 @@ int qemuProcessStart(virConnectPtr conn,
if (virSecurityManagerPreFork(driver->securityManager) < 0) if (virSecurityManagerPreFork(driver->securityManager) < 0)
goto error; goto error;
ret = virCommandRun(cmd, NULL); rv = virCommandRun(cmd, NULL);
virSecurityManagerPostFork(driver->securityManager); virSecurityManagerPostFork(driver->securityManager);
/* wait for qemu process to show up */ /* wait for qemu process to show up */
if (ret == 0) { if (rv == 0) {
if (virPidFileReadPath(priv->pidfile, &vm->pid) < 0) { if (virPidFileReadPath(priv->pidfile, &vm->pid) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Domain %s didn't show up"), vm->def->name); _("Domain %s didn't show up"), vm->def->name);
ret = -1; rv = -1;
} }
VIR_DEBUG("QEMU vm=%p name=%s running with pid=%llu", VIR_DEBUG("QEMU vm=%p name=%s running with pid=%llu",
vm, vm->def->name, (unsigned long long)vm->pid); vm, vm->def->name, (unsigned long long)vm->pid);
...@@ -4921,10 +4921,10 @@ int qemuProcessStart(virConnectPtr conn, ...@@ -4921,10 +4921,10 @@ int qemuProcessStart(virConnectPtr conn,
if (migrateFrom) if (migrateFrom)
flags |= VIR_QEMU_PROCESS_START_PAUSED; flags |= VIR_QEMU_PROCESS_START_PAUSED;
if (ret == -1) /* The VM failed to start; tear filters before taps */ if (rv == -1) /* The VM failed to start; tear filters before taps */
virDomainConfVMNWFilterTeardown(vm); virDomainConfVMNWFilterTeardown(vm);
if (ret == -1) /* The VM failed to start */ if (rv == -1) /* The VM failed to start */
goto error; goto error;
VIR_DEBUG("Setting cgroup for emulator (if required)"); VIR_DEBUG("Setting cgroup for emulator (if required)");
...@@ -4940,8 +4940,8 @@ int qemuProcessStart(virConnectPtr conn, ...@@ -4940,8 +4940,8 @@ int qemuProcessStart(virConnectPtr conn,
goto error; goto error;
/* Failure to connect to agent shouldn't be fatal */ /* Failure to connect to agent shouldn't be fatal */
if ((ret = qemuConnectAgent(driver, vm)) < 0) { if ((rv = qemuConnectAgent(driver, vm)) < 0) {
if (ret == -2) if (rv == -2)
goto error; goto error;
VIR_WARN("Cannot connect to QEMU guest agent for %s", VIR_WARN("Cannot connect to QEMU guest agent for %s",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册