[libvirt-gconfig PATCHv2 27/32] Add gvir_config_interface_network_set_source

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

 



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

diff --git a/libvirt-gconfig/libvirt-gconfig-interface-network.c b/libvirt-gconfig/libvirt-gconfig-interface-network.c
index 6e88cda..aaeb44e 100644
--- a/libvirt-gconfig/libvirt-gconfig-interface-network.c
+++ b/libvirt-gconfig/libvirt-gconfig-interface-network.c
@@ -92,3 +92,16 @@ GVirConfigInterfaceNetwork *gvir_config_interface_network_new_from_xml(const gch
                                                       "schema", DATADIR "/libvirt/schemas/interface.rng",
                                                       NULL));
 }
+
+void gvir_config_interface_network_set_source(GVirConfigInterfaceNetwork *interface,
+                                              const char *source)
+{
+    xmlNodePtr source_node;
+
+    g_return_if_fail(GVIR_IS_CONFIG_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-interface-network.h b/libvirt-gconfig/libvirt-gconfig-interface-network.h
index 0c0e542..ce29746 100644
--- a/libvirt-gconfig/libvirt-gconfig-interface-network.h
+++ b/libvirt-gconfig/libvirt-gconfig-interface-network.h
@@ -62,6 +62,9 @@ GType gvir_config_interface_network_get_type(void);
 GVirConfigInterfaceNetwork *gvir_config_interface_network_new(void);
 GVirConfigInterfaceNetwork *gvir_config_interface_network_new_from_xml(const gchar *xml,
                                                                        GError **error);
+
+void gvir_config_interface_network_set_source(GVirConfigInterfaceNetwork *interface,
+                                              const char *source);
 G_END_DECLS
 
 #endif /* __LIBVIRT_GCONFIG_INTERFACE_NETWORK_H__ */
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index 25eab10..6d7ee0e 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -53,6 +53,7 @@ LIBVIRT_GOBJECT_0.0.1 {
 	gvir_config_interface_network_get_type;
 	gvir_config_interface_network_new;
 	gvir_config_interface_network_new_from_xml;
+	gvir_config_interface_network_set_source;
 
 	gvir_config_network_get_type;
 	gvir_config_network_new;
-- 
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]