diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index dd79973d5f..0880f51115 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9636,16 +9636,13 @@ qemuDomainSnapshotFSThaw(struct qemud_driver *driver, qemuDomainObjEnterAgent(driver, vm); if (!report) - err = virGetLastError(); + err = virSaveLastError(); thawed = qemuAgentFSThaw(priv->agent); - if (!report) { - if (err) - virResetError(err); - else - virResetLastError(); - } + if (!report) + virSetError(err); qemuDomainObjExitAgent(driver, vm); + virFreeError(err); return thawed; }