mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
qemu: snapshot: Save status and config XMLs only on success
We changed to always saving the status and config XMLs to simplify code. After a few more refactors it's now possible to move it to the appropriate place and save the XMLs only on success again. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
e0720fda12
commit
93a0f72ef4
@ -15557,17 +15557,17 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
|
||||
if (rc < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0 ||
|
||||
(vm->newDef && virDomainSaveConfig(cfg->configDir, driver->caps,
|
||||
vm->newDef) < 0))
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
if (ret < 0)
|
||||
virErrorPreserveLast(&orig_err);
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0 ||
|
||||
(vm->newDef && virDomainSaveConfig(cfg->configDir, driver->caps,
|
||||
vm->newDef) < 0))
|
||||
ret = -1;
|
||||
|
||||
qemuDomainSnapshotDiskDataCleanup(diskdata, ndiskdata, driver, vm);
|
||||
virErrorRestore(&orig_err);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user