[libvirt-gconfig PATCHv2 08/32] Add gvir_config_domain_set_clock

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

 



The implementation is likely to need to be completed later. We
might want to store pointers from GVirConfigDomain to the associated
GVirConfigClock, from GVirConfigClock to the GVirConfigDomain that
contains it. Since I'm not sure yet if they will be needed, I chose
to keep the implementation simple.

--
v2: use g_return_if_fail to test function args for sanity
---
 libvirt-gconfig/libvirt-gconfig-domain.c |   12 ++++++++++++
 libvirt-gconfig/libvirt-gconfig-domain.h |    2 ++
 libvirt-gconfig/libvirt-gconfig.sym      |    1 +
 3 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/libvirt-gconfig/libvirt-gconfig-domain.c b/libvirt-gconfig/libvirt-gconfig-domain.c
index 5db6bc4..4c4ca53 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain.c
@@ -237,3 +237,15 @@ void gvir_config_domain_set_features(GVirConfigDomain *domain,
     }
     g_object_notify(G_OBJECT(domain), "features");
 }
+
+void gvir_config_domain_set_clock(GVirConfigDomain *domain,
+                                  GVirConfigClock *klock)
+{
+    xmlNodePtr clock_node;
+
+    g_return_if_fail(GVIR_IS_CONFIG_DOMAIN(domain));
+    g_return_if_fail(GVIR_IS_CONFIG_CLOCK(klock));
+
+    clock_node = gvir_config_object_get_xml_node(GVIR_CONFIG_OBJECT(klock));
+    gvir_config_object_set_child(GVIR_CONFIG_OBJECT(domain), clock_node);
+}
diff --git a/libvirt-gconfig/libvirt-gconfig-domain.h b/libvirt-gconfig/libvirt-gconfig-domain.h
index 6cc8f31..6f822cf 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain.h
@@ -69,6 +69,8 @@ void gvir_config_domain_set_memory(GVirConfigDomain *domain, guint64 memory);
 GStrv gvir_config_domain_get_features(GVirConfigDomain *domain);
 void gvir_config_domain_set_features(GVirConfigDomain *domain,
                                      const GStrv features);
+void gvir_config_domain_set_clock(GVirConfigDomain *domain,
+                                  GVirConfigClock *klock);
 
 G_END_DECLS
 
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index c3d46d5..7b346a1 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -13,6 +13,7 @@ LIBVIRT_GOBJECT_0.0.1 {
 	gvir_config_domain_get_type;
 	gvir_config_domain_new;
 	gvir_config_domain_new_from_xml;
+	gvir_config_domain_set_clock;
 	gvir_config_domain_get_features;
 	gvir_config_domain_set_features;
 	gvir_config_domain_get_memory;
-- 
1.7.7.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]