diff --git a/block/nfs.c b/block/nfs.c index 4ee2ad59d9..3349b67a76 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); @@ -574,6 +575,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; }