Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_driver.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 8093b27656..65b54b7511 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15301,7 +15301,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver, error: if (ret < 0) { - orig_err = virSaveLastError(); + virErrorPreserveLast(&orig_err); for (i = 0; i < snapdef->ndisks; i++) { if (!diskdata[i].src) continue; @@ -15341,11 +15341,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver, cleanup: qemuDomainSnapshotDiskDataFree(diskdata, snapdef->ndisks, driver, vm); - - if (orig_err) { - virSetError(orig_err); - virFreeError(orig_err); - } + virErrorRestore(&orig_err); return ret; } -- 2.21.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list