Add a method to set model of domain CPU.
---
 libvirt-gconfig/libvirt-gconfig-domain-cpu.c | 11 +++++++++++
 libvirt-gconfig/libvirt-gconfig-domain-cpu.h |  4 ++++
 libvirt-gconfig/libvirt-gconfig.sym          |  2 ++
 3 files changed, 17 insertions(+)

diff --git a/libvirt-gconfig/libvirt-gconfig-domain-cpu.c 
b/libvirt-gconfig/libvirt-gconfig-domain-cpu.c
index e7b9575..0037763 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-cpu.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-cpu.c
@@ -136,3 +136,14 @@ void gvir_config_domain_cpu_set_mode(GVirConfigDomainCpu 
*cpu,
                  "mode", GVIR_CONFIG_TYPE_DOMAIN_CPU_MODE, mode,
                  NULL);
 }
+
+void gvir_config_domain_cpu_set_model(GVirConfigDomainCpu *cpu,
+                                      GVirConfigDomainCpuModel *model)
+{
+    g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_CPU(cpu));
+    g_return_if_fail(model == NULL || GVIR_CONFIG_IS_DOMAIN_CPU_MODEL(model));
+
+    gvir_config_object_attach_replace(GVIR_CONFIG_OBJECT(cpu),
+                                      "model",
+                                      GVIR_CONFIG_OBJECT(model));
+}
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-cpu.h 
b/libvirt-gconfig/libvirt-gconfig-domain-cpu.h
index 7efb7eb..f7c0a93 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-cpu.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain-cpu.h
@@ -28,6 +28,8 @@
 #ifndef __LIBVIRT_GCONFIG_DOMAIN_CPU_H__
 #define __LIBVIRT_GCONFIG_DOMAIN_CPU_H__
 
+#include <libvirt-gconfig/libvirt-gconfig-domain-cpu-model.h>
+
 G_BEGIN_DECLS
 
 #define GVIR_CONFIG_TYPE_DOMAIN_CPU            
(gvir_config_domain_cpu_get_type ())
@@ -80,6 +82,8 @@ GVirConfigDomainCpuMatchPolicy
 gvir_config_domain_cpu_get_match_policy(GVirConfigDomainCpu *cpu);
 void gvir_config_domain_cpu_set_mode(GVirConfigDomainCpu *cpu,
                                      GVirConfigDomainCpuMode mode);
+void gvir_config_domain_cpu_set_model(GVirConfigDomainCpu *cpu,
+                                      GVirConfigDomainCpuModel *model);
 GVirConfigDomainCpuMode
 gvir_config_domain_cpu_get_mode(GVirConfigDomainCpu *cpu);
 
diff --git a/libvirt-gconfig/libvirt-gconfig.sym 
b/libvirt-gconfig/libvirt-gconfig.sym
index 4f64820..6d3fe90 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -707,6 +707,8 @@ global:
        gvir_config_domain_cpu_model_get_type;
        gvir_config_domain_cpu_model_new;
        gvir_config_domain_cpu_model_set_name;
+
+       gvir_config_domain_cpu_set_model;
 } LIBVIRT_GCONFIG_0.1.8;
 
 # .... define new API here using predicted next version number ....
-- 
1.9.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to