]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: storage: Properly set protocol type when parsing gluster json string
authorPeter Krempa <pkrempa@redhat.com>
Mon, 5 Sep 2016 13:31:44 +0000 (15:31 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 6 Sep 2016 12:01:41 +0000 (14:01 +0200)
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
tests/virstoragetest.c

index feeb06173fe24b3e7f3c3597cb0464da1344488a..02cae66830c10d36f204aa6473da43a9fe50629c 100644 (file)
@@ -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;
index f7f5030daa4ea5b55311804d5a49980382437d22..fd79abbaa5409f35405a98bd1269cafbbfbeb269 100644 (file)
@@ -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"