The implementation is likely to need to be completed later. We
might want to store pointers from GVirConfigDomain to the associated
GVirConfigDomainClock, from GVirConfigDomainClock 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 | 4 ++++
libvirt-gconfig/libvirt-gconfig.sym | 1 +
3 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/libvirt-gconfig/libvirt-gconfig-domain.c
b/libvirt-gconfig/libvirt-gconfig-domain.c
index 5db6bc4..6b55cdf 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,
+ GVirConfigDomainClock *klock)
+{
+ xmlNodePtr clock_node;
+
+ g_return_if_fail(GVIR_IS_CONFIG_DOMAIN(domain));
+ g_return_if_fail(GVIR_IS_CONFIG_DOMAIN_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..67ef432 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain.h
@@ -27,6 +27,8 @@
#ifndef __LIBVIRT_GCONFIG_DOMAIN_H__
#define __LIBVIRT_GCONFIG_DOMAIN_H__
+#include <libvirt-gconfig/libvirt-gconfig-domain-clock.h>
+
G_BEGIN_DECLS
#define GVIR_TYPE_CONFIG_DOMAIN (gvir_config_domain_get_type ())
@@ -69,6 +71,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,
+ GVirConfigDomainClock *klock);
G_END_DECLS
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index 7ee4282..7ba073b 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -7,6 +7,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