Re: [libvirt-glib 6/8] Make GVirConfigCapabilitiesCpu.get_features virtual

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

 



On Sat, Jun 23, 2012 at 10:18:02PM +0300, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak@xxxxxxxxx>
> 
> ---
>  libvirt-gconfig/libvirt-gconfig-capabilities-cpu.c |   28 +++++++++++++-------
>  libvirt-gconfig/libvirt-gconfig-capabilities-cpu.h |    4 ++-
>  2 files changed, 22 insertions(+), 10 deletions(-)
> 
> diff --git a/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.c b/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.c
> index e517a20..8d67a13 100644
> --- a/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.c
> +++ b/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.c
> @@ -37,10 +37,14 @@ struct _GVirConfigCapabilitiesCpuPrivate
>  
>  G_DEFINE_TYPE(GVirConfigCapabilitiesCpu, gvir_config_capabilities_cpu, GVIR_CONFIG_TYPE_OBJECT);
>  
> +GList *
> +_gvir_config_capabilities_cpu_get_features(GVirConfigCapabilitiesCpu *cpu);

this should be static.

>  
>  static void gvir_config_capabilities_cpu_class_init(GVirConfigCapabilitiesCpuClass *klass)
>  {
>      g_type_class_add_private(klass, sizeof(GVirConfigCapabilitiesCpuPrivate));
> +
> +    klass->get_features = _gvir_config_capabilities_cpu_get_features;
>  }
>  
>  static void gvir_config_capabilities_cpu_init(GVirConfigCapabilitiesCpu *cpu)
> @@ -98,16 +102,8 @@ static gboolean add_feature(xmlNodePtr node, gpointer opaque)
>      return TRUE;
>  }
>  
> -/**
> - * gvir_config_capabilities_cpu_get_features:
> - *
> - * Gets the features of this CPU.
> - *
> - * Returns: (element-type LibvirtGConfig.CapabilitiesCpuFeature) (transfer full):
> - * a newly allocated #GList of #GVirConfigCapabilitiesCpuFeature.
> - */
>  GList *

static GList *

> -gvir_config_capabilities_cpu_get_features(GVirConfigCapabilitiesCpu *cpu)
> +_gvir_config_capabilities_cpu_get_features(GVirConfigCapabilitiesCpu *cpu)
>  {
>      struct GetFeatureData data;
>  
> @@ -128,6 +124,20 @@ gvir_config_capabilities_cpu_get_features(GVirConfigCapabilitiesCpu *cpu)
>  }
>  
>  /**
> + * gvir_config_capabilities_cpu_get_features:
> + *
> + * Gets the features of this CPU.
> + *
> + * Returns: (element-type LibvirtGConfig.CapabilitiesCpuFeature) (transfer full):
> + * a newly allocated #GList of #GVirConfigCapabilitiesCpuFeature.
> + */
> +GList *
> +gvir_config_capabilities_cpu_get_features(GVirConfigCapabilitiesCpu *cpu)
> +{
> +    return GVIR_CONFIG_CAPABILITIES_CPU_GET_CLASS(cpu)->get_features(cpu);
> +}
> +
> +/**
>   * gvir_config_capabilities_cpu_get_topology:
>   *
>   * Gets the topology of the cpu.
> diff --git a/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.h b/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.h
> index 67fe607..d2b7094 100644
> --- a/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.h
> +++ b/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.h
> @@ -57,7 +57,9 @@ struct _GVirConfigCapabilitiesCpuClass
>  {
>      GVirConfigObjectClass parent_class;
>  
> -    gpointer padding[20];
> +    GList* (* get_features) (GVirConfigCapabilitiesCpu *cpu);

a bit too many spaces imo, libvirt-gobject-connection.h coding style is
more like:
   GList *(*get_features)(GVirConfigCapabilitiesCpu *cpu);

Christophe

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