Changeset
block/nfs.c | 7 +++++++
1 file changed, 7 insertions(+)
Git apply log
Switched to a new branch '20180516160816.26259-1-kwolf@redhat.com'
Applying: nfs: Remove processed options from QDict
To https://github.com/patchew-project/qemu
 + d5bff0f...cbf7849 patchew/20180516160816.26259-1-kwolf@redhat.com -> patchew/20180516160816.26259-1-kwolf@redhat.com (forced update)
Test passed: checkpatch

loading

Test passed: docker-mingw@fedora

loading

Test passed: docker-quick@centos7

loading

Test passed: s390x

loading

[Qemu-devel] [PATCH] nfs: Remove processed options from QDict
Posted by Kevin Wolf, 6 days ago
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


Re: [Qemu-devel] [PATCH] nfs: Remove processed options from QDict
Posted by Eric Blake, 6 days ago
On 05/16/2018 11:08 AM, 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(+)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Re: [Qemu-devel] [PATCH] nfs: Remove processed options from QDict
Posted by Jeff Cody, 6 days ago
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