[libvirt] [libvirt-glib] Add gvir_domain_get_saved()

Christophe Fergeau cfergeau at redhat.com
Thu Feb 16 08:51:34 UTC 2012


On Thu, Feb 16, 2012 at 02:26:02AM +0200, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>
> 
> Binding for virDomainHasManagedSaveImage().
> ---
>  libvirt-gobject/libvirt-gobject-domain.c |   13 +++++++++++++
>  libvirt-gobject/libvirt-gobject-domain.h |    1 +
>  libvirt-gobject/libvirt-gobject.sym      |    1 +
>  3 files changed, 15 insertions(+), 0 deletions(-)
> 
> diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c
> index d9e4c00..5f26dcd 100644
> --- a/libvirt-gobject/libvirt-gobject-domain.c
> +++ b/libvirt-gobject/libvirt-gobject-domain.c
> @@ -854,3 +854,16 @@ gboolean gvir_domain_get_persistent(GVirDomain *dom)
>  
>      return virDomainIsPersistent(dom->priv->handle) == 1;
>  }
> +
> +/**
> + * gvir_domain_get_saved:
> + * @dom: the domain
> + *
> + * Returns: TRUE if domain is in a saved state, FALSE otherwise.
                                      ^^^^^^^^^^^

I'd reword this a bit, when reading this, I'm wondering why it's not in
GVirDomainState.



> + */
> +gboolean gvir_domain_get_saved(GVirDomain *dom)

The naming needs to be more explicit, libvirt will suspend the domain after
a call to virDomainSave or virDomainManagedSave, the current name only
checks for the latter state. I'd go for
gvir_domain_has_managed_save_image();

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/20120216/44612399/attachment-0001.sig>


More information about the libvir-list mailing list