This change adds support for setting of compat XML node in libvirt
gconfig storage volumes target
---
 libvirt-gconfig/libvirt-gconfig-storage-vol-target.c | 13 +++++++++++++
 libvirt-gconfig/libvirt-gconfig-storage-vol-target.h |  2 ++
 libvirt-gconfig/libvirt-gconfig.sym                  |  5 +++++
 libvirt-gconfig/tests/test-domain-create.c           |  1 +
 4 files changed, 21 insertions(+)

diff --git a/libvirt-gconfig/libvirt-gconfig-storage-vol-target.c 
b/libvirt-gconfig/libvirt-gconfig-storage-vol-target.c
index d3151d1..b72b304 100644
--- a/libvirt-gconfig/libvirt-gconfig-storage-vol-target.c
+++ b/libvirt-gconfig/libvirt-gconfig-storage-vol-target.c
@@ -99,3 +99,16 @@ void 
gvir_config_storage_vol_target_set_permissions(GVirConfigStorageVolTarget *
                                       "permissions",
                                       GVIR_CONFIG_OBJECT(perms));
 }
+
+/**
+ * gvir_config_storage_vol_target_set_compat:
+ * @compat: (allow-none):
+ */
+void gvir_config_storage_vol_target_set_compat(GVirConfigStorageVolTarget 
*target,
+                                               const char *compat)
+{
+    g_return_if_fail(GVIR_CONFIG_IS_STORAGE_VOL_TARGET(target));
+
+    gvir_config_object_set_node_content(GVIR_CONFIG_OBJECT(target),
+                                        "compat", compat);
+}
diff --git a/libvirt-gconfig/libvirt-gconfig-storage-vol-target.h 
b/libvirt-gconfig/libvirt-gconfig-storage-vol-target.h
index b572381..c165e2b 100644
--- a/libvirt-gconfig/libvirt-gconfig-storage-vol-target.h
+++ b/libvirt-gconfig/libvirt-gconfig-storage-vol-target.h
@@ -67,6 +67,8 @@ void 
gvir_config_storage_vol_target_set_format(GVirConfigStorageVolTarget *targe
                                                const char *format);
 void gvir_config_storage_vol_target_set_permissions(GVirConfigStorageVolTarget 
*target,
                                                     
GVirConfigStoragePermissions *perms);
+void gvir_config_storage_vol_target_set_compat(GVirConfigStorageVolTarget 
*target,
+                                               const char *compat);
 
 G_END_DECLS
 
diff --git a/libvirt-gconfig/libvirt-gconfig.sym 
b/libvirt-gconfig/libvirt-gconfig.sym
index 8614126..407a52f 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -714,4 +714,9 @@ global:
        gvir_config_domain_cpu_set_model;
 } LIBVIRT_GCONFIG_0.1.8;
 
+LIBVIRT_GCONFIG_0.2.0 {
+global:
+       gvir_config_storage_vol_target_set_compat;
+} LIBVIRT_GCONFIG_0.1.9;
+
 # .... define new API here using predicted next version number ....
diff --git a/libvirt-gconfig/tests/test-domain-create.c 
b/libvirt-gconfig/tests/test-domain-create.c
index eb4b945..66f618b 100644
--- a/libvirt-gconfig/tests/test-domain-create.c
+++ b/libvirt-gconfig/tests/test-domain-create.c
@@ -482,6 +482,7 @@ int main(int argc, char **argv)
     vol_target = gvir_config_storage_vol_target_new();
     gvir_config_storage_vol_target_set_format(vol_target, "qcow2");
     gvir_config_storage_vol_target_set_permissions(vol_target, perms);
+    gvir_config_storage_vol_target_set_compat(vol_target, "1.1");
     g_object_unref(G_OBJECT(perms));
     gvir_config_storage_vol_set_target(vol, vol_target);
     g_object_unref(G_OBJECT(vol_target));
-- 
1.9.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to