mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
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:
parent
ace8e2276e
commit
83cbbbef45
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user