From nobody Wed Apr 16 03:50:32 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15264927530621012.1613215129727; Wed, 16 May 2018 10:45:53 -0700 (PDT) Received: from localhost ([::1]:58908 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJ0Uq-0000nM-B6 for importer@patchew.org; Wed, 16 May 2018 13:45:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJ0S7-00078O-D2 for qemu-devel@nongnu.org; Wed, 16 May 2018 13:43:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJ0S6-0006sn-EB for qemu-devel@nongnu.org; Wed, 16 May 2018 13:43:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37117) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fJ0S2-0006rU-2O; Wed, 16 May 2018 13:42:58 -0400 Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 43D4B39F536; Wed, 16 May 2018 17:42:57 +0000 (UTC) Received: from localhost (ovpn-116-69.phx2.redhat.com [10.3.116.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8FAAE30012A5; Wed, 16 May 2018 17:42:52 +0000 (UTC) From: Jeff Cody To: qemu-block@nongnu.org Date: Wed, 16 May 2018 13:42:34 -0400 Message-Id: <20180516174234.311-5-jcody@redhat.com> In-Reply-To: <20180516174234.311-1-jcody@redhat.com> References: <20180516174234.311-1-jcody@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 16 May 2018 17:42:57 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/4] nfs: Remove processed options from QDict X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , peter.maydell@linaro.org, jcody@redhat.com, qemu-devel@nongnu.org, qemu-stable@nongnu.org, Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Kevin Wolf 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 Message-id: 20180516160816.26259-1-kwolf@redhat.com Reviewed-by: Eric Blake Reviewed-by: Jeff Cody Signed-off-by: Jeff Cody --- block/nfs.c | 7 +++++++ 1 file changed, 7 insertions(+) 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(QD= ict *options, BlockdevOptionsNfs *opts =3D NULL; QObject *crumpled =3D NULL; Visitor *v; + const QDictEntry *e; Error *local_err =3D NULL; =20 crumpled =3D qdict_crumple(options, errp); @@ -574,6 +575,12 @@ static BlockdevOptionsNfs *nfs_options_qdict_to_qapi(Q= Dict *options, return NULL; } =20 + /* Remove the processed options from the QDict (the visitor processes + * _all_ options in the QDict) */ + while ((e =3D qdict_first(options))) { + qdict_del(options, e->key); + } + return opts; } =20 --=20 2.13.6