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

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

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]