From 83cbbbef4554bbaeaf916e67ef1d6be6701ab578 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Thu, 24 Sep 2015 09:47:13 -0400 Subject: [PATCH] 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". --- src/qemu/qemu_driver.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 562a0b6d27..0aaea7b46d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -3156,7 +3156,7 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver, virFileWrapperFdFree(wrapperFd); VIR_FREE(xml); - if (ret != 0 && needUnlink) + if (ret < 0 && needUnlink) unlink(path); return ret; @@ -3250,11 +3250,10 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom, /* Shut it down */ qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_SAVED, 0); virDomainAuditStop(vm, "saved"); - event = virDomainEventLifecycleNewFromObj(vm, - VIR_DOMAIN_EVENT_STOPPED, - VIR_DOMAIN_EVENT_STOPPED_SAVED); + event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED, + VIR_DOMAIN_EVENT_STOPPED_SAVED); endjob: - if (ret != 0) { + if (ret < 0) { if (was_running && virDomainObjIsActive(vm)) { virErrorPtr save_err = virSaveLastError(); rc = qemuProcessStartCPUs(driver, vm, dom->conn,