提交 83cbbbef 编写于 作者: J John Ferlan

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".
上级 ace8e227
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册