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

Re: [libvirt] [libvirt-glib 3/8] Setters for CapabilitiesCpuTopology props



Same concerns as with the first patch, GVirConfigCapabilitiesCpuTopology
isn't mutable, it may be worth introducing a GVirConfigDomainCpuTopology
which would contain these setters (and this would go well with the other
GVirConfigDomain classes you introduce in this series).

Christophe

On Sat, Jun 23, 2012 at 10:17:59PM +0300, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak gnome org>
> 
> ---
>  .../libvirt-gconfig-capabilities-cpu-topology.c    |   27 ++++++++++++++++++++
>  .../libvirt-gconfig-capabilities-cpu-topology.h    |    9 +++++++
>  libvirt-gconfig/libvirt-gconfig.sym                |    3 +++
>  3 files changed, 39 insertions(+)
> 
> diff --git a/libvirt-gconfig/libvirt-gconfig-capabilities-cpu-topology.c b/libvirt-gconfig/libvirt-gconfig-capabilities-cpu-topology.c
> index f34a4fe..bd46a0e 100644
> --- a/libvirt-gconfig/libvirt-gconfig-capabilities-cpu-topology.c
> +++ b/libvirt-gconfig/libvirt-gconfig-capabilities-cpu-topology.c
> @@ -85,6 +85,15 @@ gvir_config_capabilities_cpu_topology_get_sockets(GVirConfigCapabilitiesCpuTopol
>                                                     0);
>  }
>  
> +void
> +gvir_config_capabilities_cpu_topology_set_sockets(GVirConfigCapabilitiesCpuTopology *topology,
> +                                                  guint64 sockets)
> +{
> +    gvir_config_object_set_attribute_with_type(GVIR_CONFIG_OBJECT(topology),
> +                                               "sockets", G_TYPE_UINT64, sockets,
> +                                               NULL);
> +}
> +
>  guint64
>  gvir_config_capabilities_cpu_topology_get_cores(GVirConfigCapabilitiesCpuTopology *topology)
>  {
> @@ -96,6 +105,15 @@ gvir_config_capabilities_cpu_topology_get_cores(GVirConfigCapabilitiesCpuTopolog
>                                                     0);
>  }
>  
> +void
> +gvir_config_capabilities_cpu_topology_set_cores(GVirConfigCapabilitiesCpuTopology *topology,
> +                                                guint64 cores)
> +{
> +    gvir_config_object_set_attribute_with_type(GVIR_CONFIG_OBJECT(topology),
> +                                               "cores", G_TYPE_UINT64, cores,
> +                                               NULL);
> +}
> +
>  guint64
>  gvir_config_capabilities_cpu_topology_get_threads(GVirConfigCapabilitiesCpuTopology *topology)
>  {
> @@ -106,3 +124,12 @@ gvir_config_capabilities_cpu_topology_get_threads(GVirConfigCapabilitiesCpuTopol
>                                                     "threads",
>                                                     0);
>  }
> +
> +void
> +gvir_config_capabilities_cpu_topology_set_threads(GVirConfigCapabilitiesCpuTopology *topology,
> +                                                  guint64 threads)
> +{
> +    gvir_config_object_set_attribute_with_type(GVIR_CONFIG_OBJECT(topology),
> +                                               "threads", G_TYPE_UINT64, threads,
> +                                               NULL);
> +}
> diff --git a/libvirt-gconfig/libvirt-gconfig-capabilities-cpu-topology.h b/libvirt-gconfig/libvirt-gconfig-capabilities-cpu-topology.h
> index b8075a0..c589110 100644
> --- a/libvirt-gconfig/libvirt-gconfig-capabilities-cpu-topology.h
> +++ b/libvirt-gconfig/libvirt-gconfig-capabilities-cpu-topology.h
> @@ -64,10 +64,19 @@ GVirConfigCapabilitiesCpuTopology *
>  gvir_config_capabilities_cpu_topology_new_from_xml(const gchar *xml, GError **error);
>  guint64
>  gvir_config_capabilities_cpu_topology_get_sockets(GVirConfigCapabilitiesCpuTopology *topology);
> +void
> +gvir_config_capabilities_cpu_topology_set_sockets(GVirConfigCapabilitiesCpuTopology *topology,
> +                                                  guint64 sockets);
>  guint64
>  gvir_config_capabilities_cpu_topology_get_cores(GVirConfigCapabilitiesCpuTopology *topology);
> +void
> +gvir_config_capabilities_cpu_topology_set_cores(GVirConfigCapabilitiesCpuTopology *topology,
> +                                                guint64 cores);
>  guint64
>  gvir_config_capabilities_cpu_topology_get_threads(GVirConfigCapabilitiesCpuTopology *topology);
> +void
> +gvir_config_capabilities_cpu_topology_set_threads(GVirConfigCapabilitiesCpuTopology *topology,
> +                                                  guint64 threads);
>  
>  G_END_DECLS
>  
> diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
> index c319efc..d412d56 100644
> --- a/libvirt-gconfig/libvirt-gconfig.sym
> +++ b/libvirt-gconfig/libvirt-gconfig.sym
> @@ -400,8 +400,11 @@ LIBVIRT_GCONFIG_0.0.9 {
>  
>  	gvir_config_capabilities_cpu_topology_get_type;
>  	gvir_config_capabilities_cpu_topology_get_cores;
> +	gvir_config_capabilities_cpu_topology_set_cores;
>  	gvir_config_capabilities_cpu_topology_get_sockets;
> +	gvir_config_capabilities_cpu_topology_set_sockets;
>  	gvir_config_capabilities_cpu_topology_get_threads;
> +	gvir_config_capabilities_cpu_topology_set_threads;
>  	gvir_config_capabilities_cpu_topology_new;
>  	gvir_config_capabilities_cpu_topology_new_from_xml;
>  
> -- 
> 1.7.10.4
> 
> --
> libvir-list mailing list
> libvir-list redhat com
> https://www.redhat.com/mailman/listinfo/libvir-list

Attachment: pgpYAeHUzX2jD.pgp
Description: PGP signature


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