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

[libvirt] [libvirt-glib 08/10] Add GVirConfigStoragePermissions setters



---
 .../libvirt-gconfig-storage-permissions.c          |   37 ++++++++++++++++++++
 .../libvirt-gconfig-storage-permissions.h          |    9 +++++
 libvirt-gconfig/libvirt-gconfig.sym                |    4 ++
 3 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/libvirt-gconfig/libvirt-gconfig-storage-permissions.c b/libvirt-gconfig/libvirt-gconfig-storage-permissions.c
index 30854c7..c5f9f49 100644
--- a/libvirt-gconfig/libvirt-gconfig-storage-permissions.c
+++ b/libvirt-gconfig/libvirt-gconfig-storage-permissions.c
@@ -23,6 +23,7 @@
 #include <config.h>
 
 #include "libvirt-gconfig/libvirt-gconfig.h"
+#include "libvirt-gconfig/libvirt-gconfig-object-private.h"
 
 #define GVIR_CONFIG_STORAGE_PERMISSIONS_GET_PRIVATE(obj)                         \
         (G_TYPE_INSTANCE_GET_PRIVATE((obj), GVIR_TYPE_CONFIG_STORAGE_PERMISSIONS, GVirConfigStoragePermissionsPrivate))
@@ -68,3 +69,39 @@ GVirConfigStoragePermissions *gvir_config_storage_permissions_new_from_xml(const
                                              xml, error);
     return GVIR_CONFIG_STORAGE_PERMISSIONS(object);
 }
+
+void gvir_config_storage_permissions_set_group(GVirConfigStoragePermissions *perms,
+                                               guint group)
+{
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_PERMISSIONS(perms));
+
+    gvir_config_object_set_node_content_uint64(GVIR_CONFIG_OBJECT(perms),
+                                               "group", group);
+}
+
+void gvir_config_storage_permissions_set_label(GVirConfigStoragePermissions *perms,
+                                               const char *label)
+{
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_PERMISSIONS(perms));
+
+    gvir_config_object_set_node_content(GVIR_CONFIG_OBJECT(perms),
+                                        "label", label);
+}
+
+void gvir_config_storage_permissions_set_mode(GVirConfigStoragePermissions *perms,
+                                              guint mode)
+{
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_PERMISSIONS(perms));
+
+    gvir_config_object_set_node_content_uint64(GVIR_CONFIG_OBJECT(perms),
+                                               "mode", mode);
+}
+
+void gvir_config_storage_permissions_set_owner(GVirConfigStoragePermissions *perms,
+                                               guint owner)
+{
+    g_return_if_fail(GVIR_IS_CONFIG_STORAGE_PERMISSIONS(perms));
+
+    gvir_config_object_set_node_content_uint64(GVIR_CONFIG_OBJECT(perms),
+                                               "owner", owner);
+}
diff --git a/libvirt-gconfig/libvirt-gconfig-storage-permissions.h b/libvirt-gconfig/libvirt-gconfig-storage-permissions.h
index 4b3d09c..458c61d 100644
--- a/libvirt-gconfig/libvirt-gconfig-storage-permissions.h
+++ b/libvirt-gconfig/libvirt-gconfig-storage-permissions.h
@@ -63,6 +63,15 @@ GVirConfigStoragePermissions *gvir_config_storage_permissions_new(void);
 GVirConfigStoragePermissions *gvir_config_storage_permissions_new_from_xml(const gchar *xml,
                                                                            GError **error);
 
+void gvir_config_storage_permissions_set_group(GVirConfigStoragePermissions *perms,
+                                               guint group);
+void gvir_config_storage_permissions_set_label(GVirConfigStoragePermissions *perms,
+                                               const char *label);
+void gvir_config_storage_permissions_set_mode(GVirConfigStoragePermissions *perms,
+                                              guint mode);
+void gvir_config_storage_permissions_set_owner(GVirConfigStoragePermissions *perms,
+                                               guint owner);
+
 G_END_DECLS
 
 #endif /* __LIBVIRT_GCONFIG_STORAGE_PERMISSIONS_H__ */
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index b44ca99..ee7ce16 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -200,6 +200,10 @@ LIBVIRT_GCONFIG_0.0.1 {
 	gvir_config_storage_permissions_get_type;
 	gvir_config_storage_permissions_new;
 	gvir_config_storage_permissions_new_from_xml;
+	gvir_config_storage_permissions_set_group;
+	gvir_config_storage_permissions_set_label;
+	gvir_config_storage_permissions_set_mode;
+	gvir_config_storage_permissions_set_owner;
 
 	gvir_config_storage_pool_get_type;
 	gvir_config_storage_pool_new;
-- 
1.7.7.3


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