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

[libvirt] [libvirt-glib 01/10] Add some GVirConfigStorageVol setters



---
 libvirt-gconfig/libvirt-gconfig-storage-vol.c |   29 +++++++++++++++++++++++++
 libvirt-gconfig/libvirt-gconfig-storage-vol.h |    7 ++++++
 libvirt-gconfig/libvirt-gconfig.sym           |    3 ++
 3 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/libvirt-gconfig/libvirt-gconfig-storage-vol.c b/libvirt-gconfig/libvirt-gconfig-storage-vol.c
index 6711ccd..11e21cc 100644
--- a/libvirt-gconfig/libvirt-gconfig-storage-vol.c
+++ b/libvirt-gconfig/libvirt-gconfig-storage-vol.c
@@ -24,6 +24,8 @@
 #include <config.h>
 
 #include "libvirt-gconfig/libvirt-gconfig.h"
+#include "libvirt-gconfig/libvirt-gconfig-object-private.h"
+
 
 #define GVIR_CONFIG_STORAGE_VOL_GET_PRIVATE(obj)                         \
         (G_TYPE_INSTANCE_GET_PRIVATE((obj), GVIR_TYPE_CONFIG_STORAGE_VOL, GVirConfigStorageVolPrivate))
@@ -71,3 +73,30 @@ GVirConfigStorageVol *gvir_config_storage_vol_new_from_xml(const gchar *xml,
                                              xml, error);
     return GVIR_CONFIG_STORAGE_VOL(object);
 }
+
+void gvir_config_storage_vol_set_name(GVirConfigStorageVol *vol,
+                                      const char *name)
+{
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_VOL(vol));
+
+    gvir_config_object_set_node_content(GVIR_CONFIG_OBJECT(vol),
+                                        "name", name);
+}
+
+void gvir_config_storage_vol_set_capacity(GVirConfigStorageVol *vol,
+                                          guint64 capacity)
+{
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_VOL(vol));
+
+    gvir_config_object_set_node_content_uint64(GVIR_CONFIG_OBJECT(vol),
+                                               "capacity", capacity);
+}
+
+void gvir_config_storage_vol_set_allocation(GVirConfigStorageVol *vol,
+                                            guint64 allocation)
+{
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_VOL(vol));
+
+    gvir_config_object_set_node_content_uint64(GVIR_CONFIG_OBJECT(vol),
+                                               "allocation", allocation);
+}
diff --git a/libvirt-gconfig/libvirt-gconfig-storage-vol.h b/libvirt-gconfig/libvirt-gconfig-storage-vol.h
index 7deaa37..b051671 100644
--- a/libvirt-gconfig/libvirt-gconfig-storage-vol.h
+++ b/libvirt-gconfig/libvirt-gconfig-storage-vol.h
@@ -63,6 +63,13 @@ GVirConfigStorageVol *gvir_config_storage_vol_new(void);
 GVirConfigStorageVol *gvir_config_storage_vol_new_from_xml(const gchar *xml,
                                                            GError **error);
 
+void gvir_config_storage_vol_set_allocation(GVirConfigStorageVol *vol,
+                                            guint64 allocation);
+void gvir_config_storage_vol_set_capacity(GVirConfigStorageVol *vol,
+                                          guint64 capacity);
+void gvir_config_storage_vol_set_name(GVirConfigStorageVol *vol,
+                                      const char *name);
+
 G_END_DECLS
 
 #endif /* __LIBVIRT_GCONFIG_STORAGE_VOL_H__ */
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index 4ea2b1b..b340b25 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -204,6 +204,9 @@ LIBVIRT_GCONFIG_0.0.1 {
 	gvir_config_storage_vol_get_type;
 	gvir_config_storage_vol_new;
 	gvir_config_storage_vol_new_from_xml;
+	gvir_config_storage_vol_set_allocation;
+	gvir_config_storage_vol_set_capacity;
+	gvir_config_storage_vol_set_name;
 
   local:
         *;
-- 
1.7.7.3


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