[libvirt] [libvirt-glib] Add docs for gvir_config_domain_set/get_memory

Christophe Fergeau cfergeau at redhat.com
Wed Jan 4 09:36:30 UTC 2012


Hey,

On Tue, Jan 03, 2012 at 10:09:30PM +0200, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>
> 
> Its not obvious what units these functions deal with so docs are
> critical for these functions.
> ---
>  libvirt-gconfig/libvirt-gconfig-domain.c |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
> 
> diff --git a/libvirt-gconfig/libvirt-gconfig-domain.c b/libvirt-gconfig/libvirt-gconfig-domain.c
> index 3261755..c20dee8 100644
> --- a/libvirt-gconfig/libvirt-gconfig-domain.c
> +++ b/libvirt-gconfig/libvirt-gconfig-domain.c
> @@ -196,12 +196,25 @@ void gvir_config_domain_set_name(GVirConfigDomain *domain, const char *name)
>      g_object_notify(G_OBJECT(domain), "name");
>  }
>  
> +/**
> + * gvir_config_domain_get_memory:
> + * @domain: A domain configuration object.
> + *
> + * Returns: amount of RAM, in kilobytes.
> + */

I'd do the same as
http://libvirt.org/formatdomain.html#elementsMemoryAllocation and say:
"Returns: amount of RAM in kilobytes (i.e. blocks of 1024 bytes)"

>  guint64 gvir_config_domain_get_memory(GVirConfigDomain *domain)
>  {
>      return gvir_config_object_get_node_content_uint64(GVIR_CONFIG_OBJECT(domain),
>                                                        "memory");
>  }
>  
> +/**
> + * gvir_config_domain_set_memory:
> + * @domain: A domain configuration object.
> + * @memory: The amount of RAM.

The amount of RAM in kilobytes.

> + *
> + * Sets the amount of RAM allocated to @domain, in kilobytes.

And I'd append "i.e. blocks of 1024 bytes" here too.

ACK with these changes squashed in.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120104/4c21e46f/attachment-0001.sig>


More information about the libvir-list mailing list