[PATCH 12/33] virCloseCallbacksGetForConn: Remove OOM handling

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

 



VIR_EXPAND_N will abort so we can simplify the hash iterator.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/hypervisor/virclosecallbacks.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/src/hypervisor/virclosecallbacks.c b/src/hypervisor/virclosecallbacks.c
index 2641f45a22..1fd4dd7adf 100644
--- a/src/hypervisor/virclosecallbacks.c
+++ b/src/hypervisor/virclosecallbacks.c
@@ -241,7 +241,6 @@ struct _virCloseCallbacksList {
 struct virCloseCallbacksData {
     virConnectPtr conn;
     virCloseCallbacksListPtr list;
-    bool oom;
 };

 static int
@@ -263,11 +262,7 @@ virCloseCallbacksGetOne(void *payload,
     if (data->conn != closeDef->conn || !closeDef->cb)
         return 0;

-    if (VIR_EXPAND_N(data->list->entries,
-                     data->list->nentries, 1) < 0) {
-        data->oom = true;
-        return 0;
-    }
+    ignore_value(VIR_EXPAND_N(data->list->entries, data->list->nentries, 1));

     memcpy(data->list->entries[data->list->nentries - 1].uuid,
            uuid, VIR_UUID_BUFLEN);
@@ -286,17 +281,9 @@ virCloseCallbacksGetForConn(virCloseCallbacksPtr closeCallbacks,

     data.conn = conn;
     data.list = list;
-    data.oom = false;

     virHashForEach(closeCallbacks->list, virCloseCallbacksGetOne, &data);

-    if (data.oom) {
-        VIR_FREE(list->entries);
-        VIR_FREE(list);
-        virReportOOMError();
-        return NULL;
-    }
-
     return list;
 }

-- 
2.29.2




[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]

  Powered by Linux