Re: [PATCH 1/3] Turn virCapabilities into a virObject

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

 



On Wed, Feb 06, 2013 at 11:54:49 +0000, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> To enable virCapabilities instances to be reference counted,
> turn it into a virObject. All cases of virCapabilitiesFree
> turn into virObjectUnref
...
> diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
> index 4897b9a..820364b 100644
> --- a/src/conf/capabilities.c
> +++ b/src/conf/capabilities.c
...
> @@ -172,10 +191,10 @@ virCapabilitiesFreeNUMAInfo(virCapsPtr caps)
>   * Free all memory associated with capabilities
>   */
>  void
> -virCapabilitiesFree(virCapsPtr caps) {
> +virCapabilitiesDispose(void *object)

This functions has a documentation which still mentions
virCapabilitiesFree:

    /**
     * virCapabilitiesFree:
     * @caps: object to free
     *
     * Free all memory associated with capabilities
     */

> +{
> +    virCapsPtr caps = object;
>      int i;
> -    if (caps == NULL)
> -        return;
>  
>      for (i = 0 ; i < caps->nguests ; i++)
>          virCapabilitiesFreeGuest(caps->guests[i]);
...
> diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
> index 60c4109..8fada4e 100644
> --- a/src/qemu/qemu_conf.h
> +++ b/src/qemu/qemu_conf.h
> @@ -164,7 +164,7 @@ struct _virQEMUDriver {
>      /* Atomic increment only */
>      int nextvmid;
>  
> -    /* Immutable pointer. Unsafe APIs XXX */
> +    /* Immutable pointer. Immutable object */
>      virCgroupPtr cgroup;
>  
>      /* Atomic inc/dec only */

Are you sure you're changing the right comment? I'd expect the comment
for virCapsPtr caps would be changed.

...

ACK with the nits fixed.

Jirka

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