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

[libvirt] [PATCH libvirt-glib 5/5] Ensure domains & pools hash tables in connection are non-NULL



From: "Daniel P. Berrange" <berrange redhat com>

---
 libvirt-gobject/libvirt-gobject-connection.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/libvirt-gobject/libvirt-gobject-connection.c b/libvirt-gobject/libvirt-gobject-connection.c
index b6e7f3b..affb496 100644
--- a/libvirt-gobject/libvirt-gobject-connection.c
+++ b/libvirt-gobject/libvirt-gobject-connection.c
@@ -234,9 +234,15 @@ static void gvir_connection_init(GVirConnection *conn)
 
     priv = conn->priv = GVIR_CONNECTION_GET_PRIVATE(conn);
 
-    memset(priv, 0, sizeof(*priv));
-
     priv->lock = g_mutex_new();
+    priv->domains = g_hash_table_new_full(g_str_hash,
+                                          g_str_equal,
+                                          NULL,
+                                          g_object_unref);
+    priv->pools = g_hash_table_new_full(g_str_hash,
+                                        g_str_equal,
+                                        NULL,
+                                        g_object_unref);
 }
 
 
-- 
1.7.6.4


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