|
|
6ae9ed |
From 1e2350d96e59ae47fa03530ea7946ae229e99e02 Mon Sep 17 00:00:00 2001
|
|
|
6ae9ed |
Message-Id: <1e2350d96e59ae47fa03530ea7946ae229e99e02@dist-git>
|
|
|
6ae9ed |
From: Peter Krempa <pkrempa@redhat.com>
|
|
|
6ae9ed |
Date: Tue, 6 Sep 2016 14:11:23 +0200
|
|
|
6ae9ed |
Subject: [PATCH] util: storage: Properly set protocol type when parsing
|
|
|
6ae9ed |
gluster json string
|
|
|
6ae9ed |
|
|
|
6ae9ed |
Commit 2ed772cd forgot to set proper protocol. This was also present in
|
|
|
6ae9ed |
the test data.
|
|
|
6ae9ed |
|
|
|
6ae9ed |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1372251
|
|
|
6ae9ed |
(cherry picked from commit b7a650c97c717b1065c255a9be620fd2ba320180)
|
|
|
6ae9ed |
---
|
|
|
6ae9ed |
src/util/virstoragefile.c | 3 +++
|
|
|
6ae9ed |
tests/virstoragetest.c | 4 ++--
|
|
|
6ae9ed |
2 files changed, 5 insertions(+), 2 deletions(-)
|
|
|
6ae9ed |
|
|
|
6ae9ed |
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
|
|
|
6ae9ed |
index feeb061..02cae66 100644
|
|
|
6ae9ed |
--- a/src/util/virstoragefile.c
|
|
|
6ae9ed |
+++ b/src/util/virstoragefile.c
|
|
|
6ae9ed |
@@ -2786,6 +2786,9 @@ virStorageSourceParseBackingJSONGluster(virStorageSourcePtr src,
|
|
|
6ae9ed |
return -1;
|
|
|
6ae9ed |
}
|
|
|
6ae9ed |
|
|
|
6ae9ed |
+ src->type = VIR_STORAGE_TYPE_NETWORK;
|
|
|
6ae9ed |
+ src->protocol = VIR_STORAGE_NET_PROTOCOL_GLUSTER;
|
|
|
6ae9ed |
+
|
|
|
6ae9ed |
if (VIR_STRDUP(src->volume, volume) < 0 ||
|
|
|
6ae9ed |
virAsprintf(&src->path, "/%s", path) < 0)
|
|
|
6ae9ed |
return -1;
|
|
|
6ae9ed |
diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
|
|
|
6ae9ed |
index b3d59ad..623e911 100644
|
|
|
6ae9ed |
--- a/tests/virstoragetest.c
|
|
|
6ae9ed |
+++ b/tests/virstoragetest.c
|
|
|
6ae9ed |
@@ -1412,7 +1412,7 @@ mymain(void)
|
|
|
6ae9ed |
"]"
|
|
|
6ae9ed |
"}"
|
|
|
6ae9ed |
"}",
|
|
|
6ae9ed |
- "<source protocol='none' name='testvol/img.qcow2'>\n"
|
|
|
6ae9ed |
+ "<source protocol='gluster' name='testvol/img.qcow2'>\n"
|
|
|
6ae9ed |
" <host name='example.com' port='1234'/>\n"
|
|
|
6ae9ed |
" <host transport='unix' socket='/path/socket'/>\n"
|
|
|
6ae9ed |
" <host name='example.com'/>\n"
|
|
|
6ae9ed |
@@ -1432,7 +1432,7 @@ mymain(void)
|
|
|
6ae9ed |
"}"
|
|
|
6ae9ed |
"]"
|
|
|
6ae9ed |
"}",
|
|
|
6ae9ed |
- "<source protocol='none' name='testvol/img.qcow2'>\n"
|
|
|
6ae9ed |
+ "<source protocol='gluster' name='testvol/img.qcow2'>\n"
|
|
|
6ae9ed |
" <host name='example.com' port='1234'/>\n"
|
|
|
6ae9ed |
" <host transport='unix' socket='/path/socket'/>\n"
|
|
|
6ae9ed |
" <host name='example.com'/>\n"
|
|
|
6ae9ed |
--
|
|
|
6ae9ed |
2.10.0
|
|
|
6ae9ed |
|