From f25ef09fb50e82e06a5cd6b15b042917d8754008 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 6 Apr 2012 12:33:48 +0200 Subject: [PATCH] qemu_ga: Don't overwrite errors on FSThaw We can tell qemuDomainSnapshotFSThaw if we want it to report errors or not. However, if we don't want to and an error has been already set by previous qemuReportError() we must keep copy of that error not just a pointer to it. Otherwise, it get overwritten if FSThaw reports an error. (cherry picked from commit 650da0e99c56f4142273f4e369ad02bd0c008765) --- src/qemu/qemu_driver.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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; }