Re: [libvirt-glib] API to deal with storage pool(s)

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

 



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

Attachment: pgpLboMNgIaXj.pgp
Description: PGP signature

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