[libvirt] [PATCH] conf: Don't shadow error from virGetDomain()

Peter Krempa pkrempa at redhat.com
Thu Jun 28 14:35:49 UTC 2012


virGetDomain() does a good job of reporting errors itself. This patch
removes shadowing of that error in virDomainListPopulate().
---
 src/conf/virdomainlist.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/conf/virdomainlist.c b/src/conf/virdomainlist.c
index f9fbde8..2b0b878 100644
--- a/src/conf/virdomainlist.c
+++ b/src/conf/virdomainlist.c
@@ -117,8 +117,10 @@ virDomainListPopulate(void *payload,
         return;
     }

-    if (!(dom = virGetDomain(data->conn, vm->def->name, vm->def->uuid)))
-        goto no_memory;
+    if (!(dom = virGetDomain(data->conn, vm->def->name, vm->def->uuid))) {
+        data->error = true;
+        goto cleanup;
+    }

     dom->id = vm->def->id;

@@ -127,11 +129,6 @@ virDomainListPopulate(void *payload,
 cleanup:
     virDomainObjUnlock(vm);
     return;
-
-no_memory:
-    virReportOOMError();
-    data->error = true;
-    goto cleanup;
 }
 #undef MATCH

-- 
1.7.8.6




More information about the libvir-list mailing list