qemu: Clean up ret in qemuDomainSaveMemory and qemuDomainSaveInternal

As it turns out, ret can only be 0 or -1, so rather than have some comparisons
be "ret < 0" and others be "ret != 0", make them all "ret < 0".
This commit is contained in:
John Ferlan 2015-09-24 09:47:13 -04:00
parent ace8e2276e
commit 83cbbbef45

View File

@ -3156,7 +3156,7 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver,
virFileWrapperFdFree(wrapperFd); virFileWrapperFdFree(wrapperFd);
VIR_FREE(xml); VIR_FREE(xml);
if (ret != 0 && needUnlink) if (ret < 0 && needUnlink)
unlink(path); unlink(path);
return ret; return ret;
@ -3250,11 +3250,10 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom,
/* Shut it down */ /* Shut it down */
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_SAVED, 0); qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_SAVED, 0);
virDomainAuditStop(vm, "saved"); virDomainAuditStop(vm, "saved");
event = virDomainEventLifecycleNewFromObj(vm, event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_SAVED); VIR_DOMAIN_EVENT_STOPPED_SAVED);
endjob: endjob:
if (ret != 0) { if (ret < 0) {
if (was_running && virDomainObjIsActive(vm)) { if (was_running && virDomainObjIsActive(vm)) {
virErrorPtr save_err = virSaveLastError(); virErrorPtr save_err = virSaveLastError();
rc = qemuProcessStartCPUs(driver, vm, dom->conn, rc = qemuProcessStartCPUs(driver, vm, dom->conn,