From b7a650c97c717b1065c255a9be620fd2ba320180 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 5 Sep 2016 15:31:44 +0200 Subject: [PATCH] util: storage: Properly set protocol type when parsing gluster json string 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 feeb06173f..02cae66830 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 f7f5030daa..fd79abbaa5 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -1412,7 +1412,7 @@ mymain(void) "]" "}" "}", - "\n" + "\n" " \n" " \n" " \n" @@ -1432,7 +1432,7 @@ mymain(void) "}" "]" "}", - "\n" + "\n" " \n" " \n" " \n"