提交 3a96cebc 编写于 作者: E Eric Blake

storage: fix bogus target in gluster volume xml

Commit 6cd60b68 was flat out broken - it tried to print into the
wrong variable.  My testing was obviously too cursory (did the
name get a slash added?); valgrind would have caught the error.
Thankfully it didn't hit any release.

Reported by Peter Krempa.

* src/storage/storage_backend_gluster.c
(virStorageBackendGlusterRefreshVol): Fix bogus code.
Signed-off-by: NEric Blake <eblake@redhat.com>
上级 147a3d24
......@@ -227,14 +227,16 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlusterStatePtr state,
goto cleanup;
tmp = state->uri->path;
if (virAsprintf(&vol->key, "%s%s", state->uri->path, name) < 0) {
if (virAsprintf(&state->uri->path, "/%s", vol->key) < 0) {
state->uri->path = tmp;
goto cleanup;
}
if (!(vol->target.path = virURIFormat(state->uri))) {
VIR_FREE(state->uri->path);
state->uri->path = tmp;
goto cleanup;
}
VIR_FREE(state->uri->path);
state->uri->path = tmp;
if (S_ISDIR(st->st_mode)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册