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

Re: [libvirt] [libvirt-glib v2 1/8] Setters/adders for GVirConfigCapabilitiesCpu props



On Tue, Jun 26, 2012 at 05:56:13AM +0300, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak gnome org>
> 
> - gvir_config_capabilities_cpu_add_feature
> - gvir_config_capabilities_cpu_set_topology
> ---
>  libvirt-gconfig/libvirt-gconfig-capabilities-cpu.c |   32 ++++++++++++++++++++
>  libvirt-gconfig/libvirt-gconfig-capabilities-cpu.h |    6 ++++
>  libvirt-gconfig/libvirt-gconfig.sym                |    6 ++++
>  3 files changed, 44 insertions(+)
> 
> diff --git a/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.c b/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.c
> index df77364..e517a20 100644
> --- a/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.c
> +++ b/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.c
> @@ -56,6 +56,21 @@ gvir_config_capabilities_cpu_get_arch(GVirConfigCapabilitiesCpu *cpu)
>      return gvir_config_object_get_node_content(GVIR_CONFIG_OBJECT(cpu), "arch");
>  }
>  
> +/**
> + * gvir_config_capabilities_cpu_add_feature:
> + *
> + * Adds a new feature to CPU.

I don't know if it's worth mentioning in the doc that some of these objects
can be read-only? I'm not sure how to say that in a non-confusing way
though.

> + */
> +void gvir_config_capabilities_cpu_add_feature(GVirConfigCapabilitiesCpu *cpu,
> +                                              GVirConfigCapabilitiesCpuFeature *feature)
> +{
> +    g_return_if_fail(GVIR_CONFIG_IS_CAPABILITIES_CPU(cpu));
> +    g_return_if_fail(GVIR_CONFIG_IS_CAPABILITIES_CPU_FEATURE(feature));
> +
> +    gvir_config_object_attach_add(GVIR_CONFIG_OBJECT(cpu),
> +                                  GVIR_CONFIG_OBJECT(feature));
> +}
> +
>  struct GetFeatureData {
>      GVirConfigXmlDoc *doc;
>      const gchar *schema;
> @@ -133,3 +148,20 @@ gvir_config_capabilities_cpu_get_topology(GVirConfigCapabilitiesCpu *cpu)
>  
>      return GVIR_CONFIG_CAPABILITIES_CPU_TOPOLOGY(object);
>  }
> +
> +/**
> + * gvir_config_capabilities_cpu_set_topology:
> + *
> + * Sets the topology of the cpu.
> + */
> +void
> +gvir_config_capabilities_cpu_set_topology(GVirConfigCapabilitiesCpu *cpu,
> +                                          GVirConfigCapabilitiesCpuTopology *topology)
> +{
> +    g_return_if_fail(GVIR_CONFIG_IS_CAPABILITIES_CPU(cpu));
> +    g_return_if_fail(GVIR_CONFIG_IS_CAPABILITIES_CPU_TOPOLOGY(topology));
> +
> +    gvir_config_object_attach_replace(GVIR_CONFIG_OBJECT(cpu),
> +                                      "topology",
> +                                      GVIR_CONFIG_OBJECT(topology));
> +}
> diff --git a/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.h b/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.h
> index 4d896ef..67fe607 100644
> --- a/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.h
> +++ b/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.h
> @@ -29,6 +29,7 @@
>  #define __LIBVIRT_GCONFIG_CAPABILITIES_CPU_H__
>  
>  #include "libvirt-gconfig-capabilities-cpu-topology.h"
> +#include "libvirt-gconfig-capabilities-cpu-feature.h"
>  
>  G_BEGIN_DECLS
>  
> @@ -63,10 +64,15 @@ GType gvir_config_capabilities_cpu_get_type(void);
>  
>  const gchar *
>  gvir_config_capabilities_cpu_get_arch(GVirConfigCapabilitiesCpu *cpu);
> +void gvir_config_capabilities_cpu_add_feature(GVirConfigCapabilitiesCpu *cpu,
> +                                              GVirConfigCapabilitiesCpuFeature *feature);
>  GList *
>  gvir_config_capabilities_cpu_get_features(GVirConfigCapabilitiesCpu *cpu);
>  GVirConfigCapabilitiesCpuTopology *
>  gvir_config_capabilities_cpu_get_topology(GVirConfigCapabilitiesCpu *cpu);
> +void
> +gvir_config_capabilities_cpu_set_topology(GVirConfigCapabilitiesCpu *cpu,
> +                                          GVirConfigCapabilitiesCpuTopology *topology);
>  
>  G_END_DECLS
>  
> diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
> index 21942b4..1741c51 100644
> --- a/libvirt-gconfig/libvirt-gconfig.sym
> +++ b/libvirt-gconfig/libvirt-gconfig.sym
> @@ -425,4 +425,10 @@ LIBVIRT_GCONFIG_0.0.9 {
>  	gvir_config_capabilities_host_get_cpu;
>  } LIBVIRT_GCONFIG_0.0.8;
>  
> +LIBVIRT_GCONFIG_0.0.10 {

The version has been set to 0.1.0 in git.

Apart from these comments, ACK

Christophe

> +  global:
> +	gvir_config_capabilities_cpu_add_feature;
> +	gvir_config_capabilities_cpu_set_topology;
> +} LIBVIRT_GCONFIG_0.0.9;
> +
>  # .... define new API here using predicted next version number ....
> -- 
> 1.7.10.4
> 
> --
> libvir-list mailing list
> libvir-list redhat com
> https://www.redhat.com/mailman/listinfo/libvir-list

Attachment: pgp38cjDQLThI.pgp
Description: PGP signature


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