[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 11/11] gluster: fix .bdrv_reopen_prepare when backing
From: |
Max Reitz |
Subject: |
[Qemu-block] [PULL 11/11] gluster: fix .bdrv_reopen_prepare when backing file is a JSON object |
Date: |
Mon, 15 Jul 2019 16:29:05 +0200 |
From: Stefano Garzarella <address@hidden>
When the backing_file is specified as a JSON object, the
qemu_gluster_reopen_prepare() fails with this message:
invalid URI json:{"server.0.host": ...}
In this case, we should call qemu_gluster_init() using the QDict
'state->options' that contains the JSON parameters already parsed.
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1542445
Signed-off-by: Stefano Garzarella <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
block/gluster.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
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;
--
2.21.0
- [Qemu-block] [PULL 01/11] nvme: Set number of queues later in nvme_init(), (continued)
- [Qemu-block] [PULL 01/11] nvme: Set number of queues later in nvme_init(), Max Reitz, 2019/07/15
- [Qemu-block] [PULL 02/11] block: Add BDS.never_freeze, Max Reitz, 2019/07/15
- [Qemu-block] [PULL 03/11] block/stream: Fix error path, Max Reitz, 2019/07/15
- [Qemu-block] [PULL 04/11] block/stream: Swap backing file change order, Max Reitz, 2019/07/15
- [Qemu-block] [PULL 05/11] block: Deep-clear inherits_from, Max Reitz, 2019/07/15
- [Qemu-block] [PULL 06/11] iotests: Fix throttling in 030, Max Reitz, 2019/07/15
- [Qemu-block] [PULL 07/11] iotests: Compare error messages in 030, Max Reitz, 2019/07/15
- [Qemu-block] [PULL 08/11] iotests: Add @use_log to VM.run_job(), Max Reitz, 2019/07/15
- [Qemu-block] [PULL 09/11] iotests: Add new case to 030, Max Reitz, 2019/07/15
- [Qemu-block] [PULL 10/11] iotests: Add read-only test case to 030, Max Reitz, 2019/07/15
- [Qemu-block] [PULL 11/11] gluster: fix .bdrv_reopen_prepare when backing file is a JSON object,
Max Reitz <=
- Re: [Qemu-block] [PULL 00/11] Block patches for rc1, Peter Maydell, 2019/07/15