From: Max Reitz <mreitz@redhat.com>
To: Stefano Garzarella <sgarzare@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
integration@gluster.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] gluster: fix .bdrv_reopen_prepare when backing file is a JSON object
Date: Fri, 12 Jul 2019 20:35:12 +0200 [thread overview]
Message-ID: <5017daf6-2739-d260-09fd-cfccd6c77bc1@redhat.com> (raw)
In-Reply-To: <20190712104617.94707-1-sgarzare@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 1529 bytes --]
On 12.07.19 12:46, Stefano Garzarella wrote:
> 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 parameters already parsed.
>
> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1542445
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> ---
> block/gluster.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/block/gluster.c b/block/gluster.c
> index 62f8ff2147..26971db1ea 100644
> --- a/block/gluster.c
> +++ b/block/gluster.c
> @@ -931,7 +931,16 @@ 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 'bs->filename' starts with "json:", then 'state->options' will
> + * contain the parameters already parsed.
> + */
> + if (state->bs->filename && !strstart(state->bs->filename, "json:", NULL)) {
> + reop_s->glfs = qemu_gluster_init(gconf, state->bs->filename, NULL,
> + errp);
> + } else {
> + reop_s->glfs = qemu_gluster_init(gconf, NULL, state->options, errp);
> + }
Hmmm, aren’t they always in state->options?
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-07-12 18:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-12 10:46 [Qemu-devel] [PATCH] gluster: fix .bdrv_reopen_prepare when backing file is a JSON object Stefano Garzarella
2019-07-12 18:35 ` Max Reitz [this message]
2019-07-15 8:16 ` Stefano Garzarella
2019-07-15 10:53 ` Max Reitz
2019-07-15 12:50 ` Stefano Garzarella
2019-07-15 13:00 ` Max Reitz
2019-07-15 13:25 ` Stefano Garzarella
2019-07-13 12:24 ` no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5017daf6-2739-d260-09fd-cfccd6c77bc1@redhat.com \
--to=mreitz@redhat.com \
--cc=integration@gluster.org \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).