]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Don't shadow error from virGetDomain()
authorPeter Krempa <pkrempa@redhat.com>
Thu, 28 Jun 2012 14:26:07 +0000 (16:26 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 28 Jun 2012 15:56:46 +0000 (17:56 +0200)
virGetDomain() does a good job of reporting errors itself. This patch
removes shadowing of that error in virDomainListPopulate().

src/conf/virdomainlist.c

index f9fbde8989d93c506714c688be890a518e40a7f6..2b0b87881bad4aaf0e2f9484a46607feaed36c93 100644 (file)
@@ -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