[libvirt-glib 3/3] Add gvir_config_domain_cpu_set_model()

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

 



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 1ad7e18..072e9b8 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -703,6 +703,8 @@ global:
 	gvir_config_domain_chardev_source_spiceport_new_from_xml;
 	gvir_config_domain_chardev_source_spiceport_set_channel;
 
+	gvir_config_domain_cpu_set_model;
+
 	gvir_config_domain_cpu_model_get_type;
 	gvir_config_domain_cpu_model_new;
 	gvir_config_domain_cpu_model_get_name;
-- 
1.9.3

--
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]