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

[libvirt] [libvirt-glib 06/10] Add GVirConfigStoragePoolSource setters



---
 .../libvirt-gconfig-storage-pool-source.c          |  100 ++++++++++++++++++++
 .../libvirt-gconfig-storage-pool-source.h          |   17 ++++
 libvirt-gconfig/libvirt-gconfig.sym                |    8 ++
 3 files changed, 125 insertions(+), 0 deletions(-)

diff --git a/libvirt-gconfig/libvirt-gconfig-storage-pool-source.c b/libvirt-gconfig/libvirt-gconfig-storage-pool-source.c
index 5e8635b..b2223a2 100644
--- a/libvirt-gconfig/libvirt-gconfig-storage-pool-source.c
+++ b/libvirt-gconfig/libvirt-gconfig-storage-pool-source.c
@@ -70,3 +70,103 @@ GVirConfigStoragePoolSource *gvir_config_storage_pool_source_new_from_xml(const
                                              xml, error);
     return GVIR_CONFIG_STORAGE_POOL_SOURCE(object);
 }
+
+void gvir_config_storage_pool_source_set_adapter(GVirConfigStoragePoolSource *source,
+                                                 const char *adapter)
+{
+    GVirConfigObject *node;
+
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_POOL_SOURCE(source));
+
+    node = gvir_config_object_replace_child(GVIR_CONFIG_OBJECT(source), "adapter");
+    g_return_if_fail(GVIR_IS_CONFIG_OBJECT(node));
+    gvir_config_object_set_attribute(node, "name", adapter, NULL);
+    g_object_unref(G_OBJECT(node));
+}
+
+void gvir_config_storage_pool_source_set_device_path(GVirConfigStoragePoolSource *source,
+                                                     const char *device_path)
+{
+    GVirConfigObject *node;
+
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_POOL_SOURCE(source));
+
+    node = gvir_config_object_add_child(GVIR_CONFIG_OBJECT(source), "device");
+    g_return_if_fail(GVIR_IS_CONFIG_OBJECT(node));
+    gvir_config_object_set_attribute(node, "path", device_path, NULL);
+    g_object_unref(G_OBJECT(node));
+}
+
+void gvir_config_storage_pool_source_set_directory(GVirConfigStoragePoolSource *source,
+                                                   const char *directory)
+{
+    GVirConfigObject *node;
+
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_POOL_SOURCE(source));
+
+    node = gvir_config_object_replace_child(GVIR_CONFIG_OBJECT(source), "directory");
+    g_return_if_fail(GVIR_IS_CONFIG_OBJECT(node));
+    gvir_config_object_set_attribute(node, "path", directory, NULL);
+    g_object_unref(G_OBJECT(node));
+}
+
+void gvir_config_storage_pool_source_set_format(GVirConfigStoragePoolSource *source,
+                                                const char *format)
+{
+    GVirConfigObject *node;
+
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_POOL_SOURCE(source));
+
+    node = gvir_config_object_replace_child(GVIR_CONFIG_OBJECT(source), "format");
+    g_return_if_fail(GVIR_IS_CONFIG_OBJECT(node));
+    gvir_config_object_set_attribute(node, "type", format, NULL);
+    g_object_unref(G_OBJECT(node));
+}
+
+void gvir_config_storage_pool_source_set_host(GVirConfigStoragePoolSource *source,
+                                              const char *host)
+{
+    GVirConfigObject *node;
+
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_POOL_SOURCE(source));
+
+    node = gvir_config_object_replace_child(GVIR_CONFIG_OBJECT(source), "host");
+    g_return_if_fail(GVIR_IS_CONFIG_OBJECT(node));
+    gvir_config_object_set_attribute(node, "name", host, NULL);
+    g_object_unref(G_OBJECT(node));
+}
+
+void gvir_config_storage_pool_source_set_name(GVirConfigStoragePoolSource *source,
+                                              const char *name)
+{
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_POOL_SOURCE(source));
+
+    gvir_config_object_set_node_content(GVIR_CONFIG_OBJECT(source),
+                                        "name", name);
+}
+
+void gvir_config_storage_pool_source_set_product(GVirConfigStoragePoolSource *source,
+                                                 const char *product)
+{
+    GVirConfigObject *node;
+
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_POOL_SOURCE(source));
+
+    node = gvir_config_object_replace_child(GVIR_CONFIG_OBJECT(source), "product");
+    g_return_if_fail(GVIR_IS_CONFIG_OBJECT(node));
+    gvir_config_object_set_attribute(node, "name", product, NULL);
+    g_object_unref(G_OBJECT(node));
+}
+
+void gvir_config_storage_pool_source_set_vendor(GVirConfigStoragePoolSource *source,
+                                                const char *vendor)
+{
+    GVirConfigObject *node;
+
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_POOL_SOURCE(source));
+
+    node = gvir_config_object_replace_child(GVIR_CONFIG_OBJECT(source), "vendor");
+    g_return_if_fail(GVIR_IS_CONFIG_OBJECT(node));
+    gvir_config_object_set_attribute(node, "name", vendor, NULL);
+    g_object_unref(G_OBJECT(node));
+}
diff --git a/libvirt-gconfig/libvirt-gconfig-storage-pool-source.h b/libvirt-gconfig/libvirt-gconfig-storage-pool-source.h
index cd84f9c..295d65d 100644
--- a/libvirt-gconfig/libvirt-gconfig-storage-pool-source.h
+++ b/libvirt-gconfig/libvirt-gconfig-storage-pool-source.h
@@ -63,6 +63,23 @@ GVirConfigStoragePoolSource *gvir_config_storage_pool_source_new(void);
 GVirConfigStoragePoolSource *gvir_config_storage_pool_source_new_from_xml(const gchar *xml,
                                                                           GError **error);
 
+void gvir_config_storage_pool_source_set_adapter(GVirConfigStoragePoolSource *source,
+                                                 const char *adapter);
+void gvir_config_storage_pool_source_set_device_path(GVirConfigStoragePoolSource *source,
+                                                     const char *device_path);
+void gvir_config_storage_pool_source_set_directory(GVirConfigStoragePoolSource *source,
+                                                   const char *directory);
+void gvir_config_storage_pool_source_set_format(GVirConfigStoragePoolSource *source,
+                                                const char *format);
+void gvir_config_storage_pool_source_set_host(GVirConfigStoragePoolSource *source,
+                                              const char *host);
+void gvir_config_storage_pool_source_set_name(GVirConfigStoragePoolSource *source,
+                                              const char *name);
+void gvir_config_storage_pool_source_set_product(GVirConfigStoragePoolSource *source,
+                                                 const char *product);
+void gvir_config_storage_pool_source_set_vendor(GVirConfigStoragePoolSource *source,
+                                                const char *vendor);
+
 G_END_DECLS
 
 #endif /* __LIBVIRT_GCONFIG_STORAGE_POOL_SOURCE_H__ */
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index e870108..f64e77f 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -213,6 +213,14 @@ LIBVIRT_GCONFIG_0.0.1 {
 	gvir_config_storage_pool_source_get_type;
 	gvir_config_storage_pool_source_new;
 	gvir_config_storage_pool_source_new_from_xml;
+	gvir_config_storage_pool_source_set_adapter;
+	gvir_config_storage_pool_source_set_device_path;
+	gvir_config_storage_pool_source_set_directory;
+	gvir_config_storage_pool_source_set_format;
+	gvir_config_storage_pool_source_set_host;
+	gvir_config_storage_pool_source_set_name;
+	gvir_config_storage_pool_source_set_product;
+	gvir_config_storage_pool_source_set_vendor;
 
 	gvir_config_storage_pool_target_get_type;
 	gvir_config_storage_pool_target_new;
-- 
1.7.7.3


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