aboutsummaryrefslogtreecommitdiff
path: root/block/gluster.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/gluster.c')
-rw-r--r--block/gluster.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/block/gluster.c b/block/gluster.c
index 62f8ff2147..f64dc5b01e 100644
--- a/block/gluster.c
+++ b/block/gluster.c
@@ -931,7 +931,17 @@ static int qemu_gluster_reopen_prepare(BDRVReopenState *state,
gconf->has_debug = true;
gconf->logfile = g_strdup(s->logfile);
gconf->has_logfile = true;
- reop_s->glfs = qemu_gluster_init(gconf, state->bs->filename, NULL, errp);
+
+ /*
+ * If 'state->bs->exact_filename' is empty, 'state->options' should contain
+ * the JSON parameters already parsed.
+ */
+ if (state->bs->exact_filename[0] != '\0') {
+ reop_s->glfs = qemu_gluster_init(gconf, state->bs->exact_filename, NULL,
+ errp);
+ } else {
+ reop_s->glfs = qemu_gluster_init(gconf, NULL, state->options, errp);
+ }
if (reop_s->glfs == NULL) {
ret = -errno;
goto exit;