[libvirt-glib PATCHv3 21/27] Add gvir_config_domain_interface_network_set_source

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

 



---
 .../libvirt-gconfig-domain-interface-network.c     |   13 +++++++++++++
 .../libvirt-gconfig-domain-interface-network.h     |    3 +++
 libvirt-gconfig/libvirt-gconfig.sym                |    1 +
 3 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/libvirt-gconfig/libvirt-gconfig-domain-interface-network.c b/libvirt-gconfig/libvirt-gconfig-domain-interface-network.c
index fa2fb36..31e18c4 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-interface-network.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-interface-network.c
@@ -90,3 +90,16 @@ GVirConfigDomainInterfaceNetwork *gvir_config_domain_interface_network_new_from_
                                                 "node", node,
                                                 NULL));
 }
+
+void gvir_config_domain_interface_network_set_source(GVirConfigDomainInterfaceNetwork *interface,
+                                                     const char *source)
+{
+    xmlNodePtr source_node;
+
+    g_return_if_fail(GVIR_IS_CONFIG_DOMAIN_INTERFACE_NETWORK(interface));
+
+    source_node = gvir_config_object_replace_child(GVIR_CONFIG_OBJECT(interface),
+                                                   "source");
+    g_return_if_fail(source_node != NULL);
+    xmlNewProp(source_node, (xmlChar*)"network", (xmlChar*)source);
+}
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-interface-network.h b/libvirt-gconfig/libvirt-gconfig-domain-interface-network.h
index f6a355e..3891bf9 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-interface-network.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain-interface-network.h
@@ -62,6 +62,9 @@ GType gvir_config_domain_interface_network_get_type(void);
 GVirConfigDomainInterfaceNetwork *gvir_config_domain_interface_network_new(void);
 GVirConfigDomainInterfaceNetwork *gvir_config_domain_interface_network_new_from_xml(const gchar *xml,
                                                                        GError **error);
+void gvir_config_domain_interface_network_set_source(GVirConfigDomainInterfaceNetwork *interface,
+                                                     const char *source);
+
 G_END_DECLS
 
 #endif /* __LIBVIRT_GCONFIG_DOMAIN_INTERFACE_NETWORK_H__ */
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index 04b0bb9..38a82a3 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -49,6 +49,7 @@ LIBVIRT_GOBJECT_0.0.1 {
 	gvir_config_domain_interface_network_get_type;
 	gvir_config_domain_interface_network_new;
 	gvir_config_domain_interface_network_new_from_xml;
+	gvir_config_domain_interface_network_set_source;
 
 	gvir_config_domain_os_get_type;
 	gvir_config_domain_os_boot_device_get_type;
-- 
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]