Received: from eggs.gnu.org ([2001:4830:134:3::10]:43268) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLXuH-0003Nx-4W for qemu-devel@nongnu.org; Thu, 06 Mar 2014 08:00:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLXuA-00006R-F5 for qemu-devel@nongnu.org; Thu, 06 Mar 2014 08:00:12 -0500 Received: from lnantes-156-75-100-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:55824 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLXuA-0008VY-9n for qemu-devel@nongnu.org; Thu, 06 Mar 2014 08:00:06 -0500 Date: Thu, 6 Mar 2014 14:00:05 +0100 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140306130004.GB3132@irqsave.net> References: <1394055700-5988-1-git-send-email-mreitz@redhat.com> <1394055700-5988-2-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1394055700-5988-2-git-send-email-mreitz@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/5] block: Keep "filename" option after parsing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi The Wednesday 05 Mar 2014 =E0 22:41:36 (+0100), Max Reitz wrote : > Currently, bdrv_file_open() always removes the "filename" option from > the options QDict after bdrv_parse_filename() has been (successfully) > called. However, for drivers with bdrv_needs_filename, it makes more > sense for bdrv_parse_filename() to overwrite the "filename" option and > for bdrv_file_open() to fetch the filename from there. >=20 > Since there currently are no drivers that implement > bdrv_parse_filename() and have bdrv_needs_filename set, this does not > change current behavior. >=20 > Signed-off-by: Max Reitz > --- > block.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) >=20 > diff --git a/block.c b/block.c > index f01b91c..845cbfb 100644 > --- a/block.c > +++ b/block.c > @@ -1017,7 +1017,12 @@ static int bdrv_file_open(BlockDriverState *bs, = const char *filename, > ret =3D -EINVAL; > goto fail; > } > - qdict_del(*options, "filename"); > + > + if (!drv->bdrv_needs_filename) { > + qdict_del(*options, "filename"); > + } else { > + filename =3D qdict_get_str(*options, "filename"); > + } > } > =20 > if (!drv->bdrv_file_open) { > --=20 > 1.9.0 >=20 >=20 Looks innocuous. Reviewed-by: Benoit Canet