--
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.h | 4 +++-
libvirt-gconfig/libvirt-gconfig.sym | 1 +
4 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/libvirt-gconfig/libvirt-gconfig-domain.c
b/libvirt-gconfig/libvirt-gconfig-domain.c
index 4c4ca53..bc2a1f3 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain.c
@@ -249,3 +249,15 @@ void gvir_config_domain_set_clock(GVirConfigDomain *domain,
clock_node = gvir_config_object_get_xml_node(GVIR_CONFIG_OBJECT(klock));
gvir_config_object_set_child(GVIR_CONFIG_OBJECT(domain), clock_node);
}
+
+void gvir_config_domain_set_os(GVirConfigDomain *domain,
+ GVirConfigOs *os)
+{
+ xmlNodePtr os_node;
+
+ g_return_if_fail(GVIR_IS_CONFIG_DOMAIN(domain));
+ g_return_if_fail(GVIR_IS_CONFIG_OS(os));
+
+ os_node = gvir_config_object_get_xml_node(GVIR_CONFIG_OBJECT(os));
+ gvir_config_object_set_child(GVIR_CONFIG_OBJECT(domain), os_node);
+}
diff --git a/libvirt-gconfig/libvirt-gconfig-domain.h
b/libvirt-gconfig/libvirt-gconfig-domain.h
index 6f822cf..37effe4 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain.h
@@ -71,6 +71,8 @@ void gvir_config_domain_set_features(GVirConfigDomain *domain,
const GStrv features);
void gvir_config_domain_set_clock(GVirConfigDomain *domain,
GVirConfigClock *klock);
+void gvir_config_domain_set_os(GVirConfigDomain *domain,
+ GVirConfigOs *os);
G_END_DECLS
diff --git a/libvirt-gconfig/libvirt-gconfig.h b/libvirt-gconfig/libvirt-gconfig.h
index 482c088..0f09d4f 100644
--- a/libvirt-gconfig/libvirt-gconfig.h
+++ b/libvirt-gconfig/libvirt-gconfig.h
@@ -29,7 +29,6 @@
#include <libvirt-gconfig/libvirt-gconfig-object.h>
#include <libvirt-gconfig/libvirt-gconfig-capabilities.h>
#include <libvirt-gconfig/libvirt-gconfig-clock.h>
-#include <libvirt-gconfig/libvirt-gconfig-domain.h>
#include <libvirt-gconfig/libvirt-gconfig-domain-snapshot.h>
#include <libvirt-gconfig/libvirt-gconfig-enum-types.h>
#include <libvirt-gconfig/libvirt-gconfig-helpers.h>
@@ -43,4 +42,7 @@
#include <libvirt-gconfig/libvirt-gconfig-storage-pool.h>
#include <libvirt-gconfig/libvirt-gconfig-storage-vol.h>
+/* Must come last since it uses types defined in the other headers */
+#include <libvirt-gconfig/libvirt-gconfig-domain.h>
+
#endif /* __LIBVIRT_GCONFIG_H__ */
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index 1a924c1..0d68f92 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -16,6 +16,7 @@ LIBVIRT_GOBJECT_0.0.1 {
gvir_config_domain_new;
gvir_config_domain_new_from_xml;
gvir_config_domain_set_clock;
+ gvir_config_domain_set_os;
gvir_config_domain_get_features;
gvir_config_domain_set_features;
gvir_config_domain_get_memory;
--
1.7.7.3