qemu: snapshot: Unify 'cleanup' and 'error' in qemuDomainSnapshotCreateDiskActive

All cases taking the 'cleanup' path can take the original 'error' path.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2019-06-05 15:33:53 +02:00
parent 46da762669
commit 0325d42668

View File

@ -15267,7 +15267,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
if (qemuDomainSnapshotCreateSingleDiskActive(driver, vm, if (qemuDomainSnapshotCreateSingleDiskActive(driver, vm,
&diskdata[i], &diskdata[i],
actions, reuse) < 0) actions, reuse) < 0)
goto error; goto cleanup;
do_transaction = true; do_transaction = true;
} }
@ -15291,12 +15291,12 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
} }
if (rc < 0) if (rc < 0)
goto error; goto cleanup;
} }
ret = 0; ret = 0;
error: cleanup:
if (ret < 0) { if (ret < 0) {
virErrorPreserveLast(&orig_err); virErrorPreserveLast(&orig_err);
} else { } else {
@ -15320,7 +15320,6 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
vm->newDef) < 0)) vm->newDef) < 0))
ret = -1; ret = -1;
cleanup:
qemuDomainSnapshotDiskDataCleanup(diskdata, ndiskdata, driver, vm); qemuDomainSnapshotDiskDataCleanup(diskdata, ndiskdata, driver, vm);
virErrorRestore(&orig_err); virErrorRestore(&orig_err);