qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Cody <jcody@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-block@nongnu.org, mreitz@redhat.com, qemu-stable@nongnu.org,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] nfs: Remove processed options from QDict
Date: Wed, 16 May 2018 13:10:12 -0400	[thread overview]
Message-ID: <20180516171012.GB6999@localhost.localdomain> (raw)
In-Reply-To: <20180516160816.26259-1-kwolf@redhat.com>

On Wed, May 16, 2018 at 06:08:16PM +0200, Kevin Wolf wrote:
> Commit c22a03454 QAPIfied option parsing in the NFS block driver, but
> forgot to remove all the options we processed. Therefore, we get an
> error in bdrv_open_inherit(), which thinks the remaining options are
> invalid. Trying to open an NFS image will result in an error like this:
> 
>     Block protocol 'nfs' doesn't support the option 'server.host'
> 
> Remove all options from the QDict to make the NFS driver work again.
> 
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  block/nfs.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/block/nfs.c b/block/nfs.c
> index 66fddf12d4..d6364d28bb 100644
> --- a/block/nfs.c
> +++ b/block/nfs.c
> @@ -557,6 +557,7 @@ static BlockdevOptionsNfs *nfs_options_qdict_to_qapi(QDict *options,
>      BlockdevOptionsNfs *opts = NULL;
>      QObject *crumpled = NULL;
>      Visitor *v;
> +    const QDictEntry *e;
>      Error *local_err = NULL;
>  
>      crumpled = qdict_crumple(options, errp);
> @@ -573,6 +574,12 @@ static BlockdevOptionsNfs *nfs_options_qdict_to_qapi(QDict *options,
>          return NULL;
>      }
>  
> +    /* Remove the processed options from the QDict (the visitor processes
> +     * _all_ options in the QDict) */
> +    while ((e = qdict_first(options))) {
> +        qdict_del(options, e->key);
> +    }
> +
>      return opts;
>  }
>  
> -- 
> 2.13.6
> 

Thanks,

Applied to my block branch:

git://github.com/codyprime/qemu-kvm-jtc block

-Jeff

      parent reply	other threads:[~2018-05-16 17:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16 16:08 [Qemu-devel] [PATCH] nfs: Remove processed options from QDict Kevin Wolf
2018-05-16 16:48 ` Eric Blake
2018-05-16 17:10 ` Jeff Cody [this message]

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=20180516171012.GB6999@localhost.localdomain \
    --to=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /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).