[libvirt] [libvirt-glib 2/3] Add host capabilities API

Zeeshan Ali (Khattak) zeeshanak at gnome.org
Fri May 4 02:02:37 UTC 2012


On Wed, May 2, 2012 at 5:25 PM, Christophe Fergeau <cfergeau at redhat.com> wrote:
> On Tue, May 01, 2012 at 08:30:39PM +0300, Zeeshan Ali (Khattak) wrote:
>> From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>
>>
>> Not quite complete but its a good start.

CUT

>> ---
>> +/**
>> + * 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 *caps)
>> +{
>> +    struct GetFeatureData data;
>> +    xmlNodePtr node;
>> +
>> +    g_return_val_if_fail(GVIR_CONFIG_IS_CAPABILITIES_CPU(caps), NULL);
>> +
>> +    node = gvir_config_object_get_xml_node(GVIR_CONFIG_OBJECT(caps));
>> +    g_return_val_if_fail(node != NULL, NULL);
>> +
>> +    g_object_get(G_OBJECT(caps), "doc", &data.doc, NULL);
>> +    data.features = NULL;
>> +
>> +    gvir_config_xml_foreach_child(node, add_feature, &data);
>
> gvir_config_object_foreach_child

Not really, gvir_config_object_foreach_child seem to iterate grand
children of the object node and we are iterating direct children.

-- 
Regards,

Zeeshan Ali (Khattak)
FSF member#5124




More information about the libvir-list mailing list