[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 5/5] qemu: Disable errors in qemudShutdownVMDaemon



Signed-off-by: Cole Robinson <crobinso redhat com>
---
 src/qemu/qemu_driver.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index fc6b9fa..38be88f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2616,12 +2616,17 @@ static void qemudShutdownVMDaemon(virConnectPtr conn,
     int ret;
     int retries = 0;
     qemuDomainObjPrivatePtr priv = vm->privateData;
+    virErrorPtr origerr = NULL;
 
     if (!virDomainObjIsActive(vm))
         return;
 
     VIR_DEBUG("Shutting down VM '%s'", vm->def->name);
 
+    /* This method is routinely used in clean up paths. Disable error
+     * reporting so we don't squash a legit error. */
+    origerr = virSaveLastError();
+
     if (driver->macFilter) {
         int i;
         virDomainDefPtr def = vm->def;
@@ -2701,6 +2706,11 @@ retry:
         vm->def->id = -1;
         vm->newDef = NULL;
     }
+
+    if (origerr) {
+        virSetError(origerr);
+        virFreeError(origerr);
+    }
 }
 
 
-- 
1.6.5.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]