Re: [libvirt-glib 2/4] Add gvir_config_domain_get_os()

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

 



On Fri, May 04, 2012 at 03:07:43AM +0300, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak@xxxxxxxxx>
> 
> ---
>  libvirt-gconfig/libvirt-gconfig-domain.c |   18 ++++++++++++++++++
>  libvirt-gconfig/libvirt-gconfig-domain.h |    1 +
>  libvirt-gconfig/libvirt-gconfig.sym      |    5 +++++
>  3 files changed, 24 insertions(+), 0 deletions(-)
> 
> diff --git a/libvirt-gconfig/libvirt-gconfig-domain.c b/libvirt-gconfig/libvirt-gconfig-domain.c
> index 04915ab..b19ac4c 100644
> --- a/libvirt-gconfig/libvirt-gconfig-domain.c
> +++ b/libvirt-gconfig/libvirt-gconfig-domain.c
> @@ -323,6 +323,24 @@ void gvir_config_domain_set_clock(GVirConfigDomain *domain,
>                                        GVIR_CONFIG_OBJECT(klock));
>  }
>  
> +/**
> + * gvir_config_domain_get_os:
> + *
> + * Returns: (transfer full):
> + */
> +GVirConfigDomainOs *gvir_config_domain_get_os(GVirConfigDomain *domain)
> +{
> +    GVirConfigObject *object;
> +
> +    g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN(domain), NULL);
> +
> +    object = gvir_config_object_add_child(GVIR_CONFIG_OBJECT(domain),
> +                                          "os",
> +                                          GVIR_CONFIG_TYPE_DOMAIN_OS);
> +
> +    return GVIR_CONFIG_DOMAIN_OS(object);
> +}

We want to return a NULL object when there is no "os" node in the
configuration I think, or to create a default node with the default values
if the presence of this node is mandatory and if libvirt doesn't create it for
us.

Christophe
> +
>  void gvir_config_domain_set_os(GVirConfigDomain *domain,
>                                 GVirConfigDomainOs *os)
>  {
> diff --git a/libvirt-gconfig/libvirt-gconfig-domain.h b/libvirt-gconfig/libvirt-gconfig-domain.h
> index 1dbfd95..bdb842b 100644
> --- a/libvirt-gconfig/libvirt-gconfig-domain.h
> +++ b/libvirt-gconfig/libvirt-gconfig-domain.h
> @@ -114,6 +114,7 @@ void gvir_config_domain_set_features(GVirConfigDomain *domain,
>                                       const GStrv features);
>  void gvir_config_domain_set_clock(GVirConfigDomain *domain,
>                                    GVirConfigDomainClock *klock);
> +GVirConfigDomainOs *gvir_config_domain_get_os(GVirConfigDomain *domain);
>  void gvir_config_domain_set_os(GVirConfigDomain *domain,
>                                 GVirConfigDomainOs *os);
>  void gvir_config_domain_set_seclabel(GVirConfigDomain *domain,
> diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
> index ffeb16b..67e9c3f 100644
> --- a/libvirt-gconfig/libvirt-gconfig.sym
> +++ b/libvirt-gconfig/libvirt-gconfig.sym
> @@ -374,4 +374,9 @@ LIBVIRT_GCONFIG_0.0.8 {
>          *;
>  };
>  
> +LIBVIRT_GCONFIG_0.0.9 {
> +  global:
> +	gvir_config_domain_get_os;
> +} LIBVIRT_GCONFIG_0.0.8;
> +
>  # .... define new API here using predicted next version number ....
> -- 
> 1.7.7.6
> 
> --
> libvir-list mailing list
> libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list

Attachment: pgpKhvhDdIBt8.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]