[GEDI] [PATCH] gluster: fix .bdrv_reopen_prepare when backing file is a JSON object

Max Reitz mreitz at redhat.com
Fri Jul 12 18:35:12 UTC 2019


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 at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.gluster.org/pipermail/integration/attachments/20190712/22463d9b/attachment-0001.sig>


More information about the integration mailing list