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

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



Hi,

I assume without this, it's easy to try to add data to NULL hash tables
when using the transient domain API you added in this patch series?
ACK patch, just curious...

Christophe

On Tue, Nov 22, 2011 at 12:39:32PM +0000, Daniel P. Berrange wrote:
> 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
> 
> --
> libvir-list mailing list
> libvir-list redhat com
> https://www.redhat.com/mailman/listinfo/libvir-list

Attachment: pgp7d9HJlPKWy.pgp
Description: PGP signature


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