-- 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 | 3 +++ libvirt-gconfig/libvirt-gconfig.sym | 1 + 3 files changed, 16 insertions(+), 0 deletions(-) diff --git a/libvirt-gconfig/libvirt-gconfig-domain.c b/libvirt-gconfig/libvirt-gconfig-domain.c index 6b55cdf..8fb1c11 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, + GVirConfigDomainOs *os) +{ + xmlNodePtr os_node; + + g_return_if_fail(GVIR_IS_CONFIG_DOMAIN(domain)); + g_return_if_fail(GVIR_IS_CONFIG_DOMAIN_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 67ef432..2f33988 100644 --- a/libvirt-gconfig/libvirt-gconfig-domain.h +++ b/libvirt-gconfig/libvirt-gconfig-domain.h @@ -28,6 +28,7 @@ #define __LIBVIRT_GCONFIG_DOMAIN_H__ #include <libvirt-gconfig/libvirt-gconfig-domain-clock.h> +#include <libvirt-gconfig/libvirt-gconfig-domain-os.h> G_BEGIN_DECLS @@ -73,6 +74,8 @@ void gvir_config_domain_set_features(GVirConfigDomain *domain, const GStrv features); void gvir_config_domain_set_clock(GVirConfigDomain *domain, GVirConfigDomainClock *klock); +void gvir_config_domain_set_os(GVirConfigDomain *domain, + GVirConfigDomainOs *os); G_END_DECLS diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym index 83e4e0c..ba9e051 100644 --- a/libvirt-gconfig/libvirt-gconfig.sym +++ b/libvirt-gconfig/libvirt-gconfig.sym @@ -8,6 +8,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 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list