mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +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);
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user