
On Tue, Sep 27, 2011 at 01:19:56AM +0300, Zeeshan Ali (Khattak) wrote:
+gboolean gvir_connection_fetch_storage_pools(GVirConnection *conn, + GCancellable *cancellable, + GError **err) +{ + GVirConnectionPrivate *priv = conn->priv; + GHashTable *pools; + gchar **inactive = NULL; + gint ninactive = 0; + gchar **active = NULL; + gint nactive = 0; + gboolean ret = FALSE; + gint i; + virConnectPtr vconn = NULL; + + g_mutex_lock(priv->lock); + if (!priv->conn) { + *err = gvir_error_new(GVIR_CONNECTION_ERROR, + 0, + "Connection is not open");
gvir_error_new creates a new GError and automatically appends the last error message reported by libvirt (if any) to it. In this case, won't we get a potentially confusing error message from libvirt since we don't really know what happened before this function was called? The same pattern occurs several times throughout this file. Christophe