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

[libvirt] [libvirt-glib 02/10] Add GVirConfigStoragePool setters



---
 libvirt-gconfig/libvirt-gconfig-storage-pool.c |   49 +++++++++++++++++++++++-
 libvirt-gconfig/libvirt-gconfig-storage-pool.h |   11 +++++
 libvirt-gconfig/libvirt-gconfig.sym            |    5 ++
 3 files changed, 64 insertions(+), 1 deletions(-)

diff --git a/libvirt-gconfig/libvirt-gconfig-storage-pool.c b/libvirt-gconfig/libvirt-gconfig-storage-pool.c
index 3cda75b..6c64087 100644
--- a/libvirt-gconfig/libvirt-gconfig-storage-pool.c
+++ b/libvirt-gconfig/libvirt-gconfig-storage-pool.c
@@ -18,12 +18,14 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  *
- * Author: Daniel P. Berrange <berrange redhat com>
+ * Authors: Daniel P. Berrange <berrange redhat com>
+ *          Christophe Fergeau <cfergeau redhat com>
  */
 
 #include <config.h>
 
 #include "libvirt-gconfig/libvirt-gconfig.h"
+#include "libvirt-gconfig/libvirt-gconfig-object-private.h"
 
 #define GVIR_CONFIG_STORAGE_POOL_GET_PRIVATE(obj)                         \
         (G_TYPE_INSTANCE_GET_PRIVATE((obj), GVIR_TYPE_CONFIG_STORAGE_POOL, GVirConfigStoragePoolPrivate))
@@ -71,3 +73,48 @@ GVirConfigStoragePool *gvir_config_storage_pool_new_from_xml(const gchar *xml,
                                              xml, error);
     return GVIR_CONFIG_STORAGE_POOL(object);
 }
+
+void gvir_config_storage_pool_set_name(GVirConfigStoragePool *pool,
+                                       const char *name)
+{
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_POOL(pool));
+
+    gvir_config_object_set_node_content(GVIR_CONFIG_OBJECT(pool),
+                                        "name", name);
+}
+
+void gvir_config_storage_pool_set_uuid(GVirConfigStoragePool *pool,
+                                       const char *uuid)
+{
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_POOL(pool));
+
+    gvir_config_object_set_node_content(GVIR_CONFIG_OBJECT(pool),
+                                        "uuid", uuid);
+}
+
+void gvir_config_storage_pool_set_capacity(GVirConfigStoragePool *pool,
+                                           guint64 capacity)
+{
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_POOL(pool));
+
+    gvir_config_object_set_node_content_uint64(GVIR_CONFIG_OBJECT(pool),
+                                               "capacity", capacity);
+}
+
+void gvir_config_storage_pool_set_allocation(GVirConfigStoragePool *pool,
+                                             guint64 allocation)
+{
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_POOL(pool));
+
+    gvir_config_object_set_node_content_uint64(GVIR_CONFIG_OBJECT(pool),
+                                               "allocation", allocation);
+}
+
+void gvir_config_storage_pool_set_available(GVirConfigStoragePool *pool,
+                                            guint64 available)
+{
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_POOL(pool));
+
+    gvir_config_object_set_node_content_uint64(GVIR_CONFIG_OBJECT(pool),
+                                               "available", available);
+}
diff --git a/libvirt-gconfig/libvirt-gconfig-storage-pool.h b/libvirt-gconfig/libvirt-gconfig-storage-pool.h
index bbaa92f..8ffdf77 100644
--- a/libvirt-gconfig/libvirt-gconfig-storage-pool.h
+++ b/libvirt-gconfig/libvirt-gconfig-storage-pool.h
@@ -63,6 +63,17 @@ GVirConfigStoragePool *gvir_config_storage_pool_new(void);
 GVirConfigStoragePool *gvir_config_storage_pool_new_from_xml(const gchar *xml,
                                                              GError **error);
 
+void gvir_config_storage_pool_set_allocation(GVirConfigStoragePool *pool,
+                                             guint64 allocation);
+void gvir_config_storage_pool_set_available(GVirConfigStoragePool *pool,
+                                            guint64 available);
+void gvir_config_storage_pool_set_capacity(GVirConfigStoragePool *pool,
+                                           guint64 capacity);
+void gvir_config_storage_pool_set_name(GVirConfigStoragePool *pool,
+                                       const char *name);
+void gvir_config_storage_pool_set_uuid(GVirConfigStoragePool *pool,
+                                       const char *uuid);
+
 G_END_DECLS
 
 #endif /* __LIBVIRT_GCONFIG_STORAGE_POOL_H__ */
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index b340b25..60026af 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -200,6 +200,11 @@ LIBVIRT_GCONFIG_0.0.1 {
 	gvir_config_storage_pool_get_type;
 	gvir_config_storage_pool_new;
 	gvir_config_storage_pool_new_from_xml;
+	gvir_config_storage_pool_set_allocation;
+	gvir_config_storage_pool_set_available;
+	gvir_config_storage_pool_set_capacity;
+	gvir_config_storage_pool_set_name;
+	gvir_config_storage_pool_set_uuid;
 
 	gvir_config_storage_vol_get_type;
 	gvir_config_storage_vol_new;
-- 
1.7.7.3


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