I think the code looks cleaner without else branches.
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
if (STREQ(phase, "none"))
return 0;
- else
- return -1;
+
+ return -1;
}
rc = qemuMigrationSrcWaitForCompletion(driver, vm,
QEMU_ASYNC_JOB_MIGRATION_OUT,
dconn, waitFlags);
- if (rc == -2) {
+ if (rc == -2)
goto error;
- } else if (rc == -1) {
+
+ if (rc == -1) {
/* QEMU reported failed migration, nothing to cancel anymore */
cancel = false;
goto error;
rc = qemuMigrationSrcWaitForCompletion(driver, vm,
QEMU_ASYNC_JOB_MIGRATION_OUT,
dconn, waitFlags);
- if (rc == -2) {
+ if (rc == -2)
goto error;
- } else if (rc == -1) {
+
+ if (rc == -1) {
/* QEMU reported failed migration, nothing to cancel anymore */
cancel = false;
goto error;
driver->migrationErrors = virHashAtomicNew(qemuMigrationDstErrorFree);
if (driver->migrationErrors)
return 0;
- else
- return -1;
+
+ return -1;
}
/**
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV))
return qemuBlockJobRefreshJobs(driver, vm);
- else
- return qemuProcessRefreshLegacyBlockjobs(driver, vm);
+
+ return qemuProcessRefreshLegacyBlockjobs(driver, vm);
}
_("missing existing file for disk %s: %s"),
snapdisk->name, snapdisk->src->path);
return -1;
- } else {
- if (snapdisk->src->type == VIR_STORAGE_TYPE_BLOCK) {
- virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
- _("block device snapshot target '%s' doesn't exist"),
- snapdisk->src->path);
- return -1;
- }
+ }
+
+ if (snapdisk->src->type == VIR_STORAGE_TYPE_BLOCK) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+ _("block device snapshot target '%s' doesn't exist"),
+ snapdisk->src->path);
+ return -1;
}
} else {
/* at this point VIR_STORAGE_TYPE_DIR was already rejected */