The 'ret' variable is set to 0 before a call which can theoretically
fail. Not in practice really as the failure scenarion includes only
object initialization.
Since the code already has another variable for checking monitor returns
use that one properly so that the code makes sense.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
goto cleanup;
}
- ret = 0;
} else {
if (qemuDomainObjEnterMonitorAsync(vm, VIR_ASYNC_JOB_SNAPSHOT) < 0) {
resume = false;
goto cleanup;
}
- ret = qemuMonitorCreateSnapshot(priv->mon, snap->def->name);
+ rv = qemuMonitorCreateSnapshot(priv->mon, snap->def->name);
qemuDomainObjExitMonitor(vm);
- if (ret < 0)
+ if (rv < 0)
goto cleanup;
}
resume = false;
}
+ ret = 0;
+
cleanup:
if (resume && virDomainObjIsActive(vm) &&
qemuProcessStartCPUs(driver, vm,