1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

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
This commit is contained in:
Peter Krempa 2016-09-05 15:31:44 +02:00
parent 56f09042ef
commit b7a650c97c
2 changed files with 5 additions and 2 deletions

View 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;

View 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"