--- libvirt-gconfig/libvirt-gconfig-domain.c | 21 +++++++++++++++++++++ libvirt-gconfig/libvirt-gconfig-domain.h | 2 ++ libvirt-gconfig/libvirt-gconfig.sym | 3 ++- 3 files changed, 25 insertions(+), 1 deletions(-) diff --git a/libvirt-gconfig/libvirt-gconfig-domain.c b/libvirt-gconfig/libvirt-gconfig-domain.c index 88b46fb..8f6c50f 100644 --- a/libvirt-gconfig/libvirt-gconfig-domain.c +++ b/libvirt-gconfig/libvirt-gconfig-domain.c @@ -283,3 +283,24 @@ void gvir_config_domain_set_os(GVirConfigDomain *domain, os_node = gvir_config_object_get_xml_node(GVIR_CONFIG_OBJECT(os)); gvir_config_object_set_child(GVIR_CONFIG_OBJECT(domain), os_node); } + +/** + * gvir_config_domain_set_devices: + * @devices: (in) (element-type LibvirtGConfig.Device): + */ +void gvir_config_domain_set_devices(GVirConfigDomain *domain, + GList *devices) +{ + xmlNodePtr devices_node; + GList *it; + + devices_node = gvir_config_object_new_child(GVIR_CONFIG_OBJECT(domain), + "devices", TRUE); + for (it = devices; it != NULL; it = it->next) { + GVirConfigDevice *device = GVIR_CONFIG_DEVICE(it->data); + xmlNodePtr node; + + node = gvir_config_object_get_xml_node(GVIR_CONFIG_OBJECT(device)); + xmlAddChild(devices_node, node); + } +} diff --git a/libvirt-gconfig/libvirt-gconfig-domain.h b/libvirt-gconfig/libvirt-gconfig-domain.h index 3ca6228..da798e8 100644 --- a/libvirt-gconfig/libvirt-gconfig-domain.h +++ b/libvirt-gconfig/libvirt-gconfig-domain.h @@ -76,6 +76,8 @@ void gvir_config_domain_set_clock(GVirConfigDomain *domain, GVirConfigClock *klock); void gvir_config_domain_set_os(GVirConfigDomain *domain, GVirConfigOs *os); +void gvir_config_domain_set_devices(GVirConfigDomain *domain, + GList *devices); G_END_DECLS diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym index 76ffc4c..963ca53 100644 --- a/libvirt-gconfig/libvirt-gconfig.sym +++ b/libvirt-gconfig/libvirt-gconfig.sym @@ -28,13 +28,14 @@ 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_set_devices; gvir_config_domain_get_features; gvir_config_domain_set_features; gvir_config_domain_get_memory; gvir_config_domain_set_memory; gvir_config_domain_get_name; gvir_config_domain_set_name; + gvir_config_domain_set_os; gvir_config_domain_get_vcpus; gvir_config_domain_set_vcpus; -- 1.7.7 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list