From: "Zeeshan Ali (Khattak)" <zeesha...@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. + */ +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 { + 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