[PATCH 1/2] util: storage: Properly set protocol type when parsing gluster json string

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

 



Commit 2ed772cd forgot to set proper protocol. This was also present in
the test data.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1372251
---
 src/util/virstoragefile.c | 3 +++
 tests/virstoragetest.c    | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index feeb061..02cae66 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -2786,6 +2786,9 @@ virStorageSourceParseBackingJSONGluster(virStorageSourcePtr src,
         return -1;
     }

+    src->type = VIR_STORAGE_TYPE_NETWORK;
+    src->protocol = VIR_STORAGE_NET_PROTOCOL_GLUSTER;
+
     if (VIR_STRDUP(src->volume, volume) < 0 ||
         virAsprintf(&src->path, "/%s", path) < 0)
         return -1;
diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
index f7f5030..fd79abb 100644
--- a/tests/virstoragetest.c
+++ b/tests/virstoragetest.c
@@ -1412,7 +1412,7 @@ mymain(void)
                                                   "]"
                                       "}"
                              "}",
-                        "<source protocol='none' name='testvol/img.qcow2'>\n"
+                        "<source protocol='gluster' name='testvol/img.qcow2'>\n"
                         "  <host name='example.com' port='1234'/>\n"
                         "  <host transport='unix' socket='/path/socket'/>\n"
                         "  <host name='example.com'/>\n"
@@ -1432,7 +1432,7 @@ mymain(void)
                                                "}"
                                              "]"
                             "}",
-                        "<source protocol='none' name='testvol/img.qcow2'>\n"
+                        "<source protocol='gluster' name='testvol/img.qcow2'>\n"
                         "  <host name='example.com' port='1234'/>\n"
                         "  <host transport='unix' socket='/path/socket'/>\n"
                         "  <host name='example.com'/>\n"
-- 
2.9.2

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]