From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7cJj-0004iR-Nl for qemu-devel@nongnu.org; Sun, 26 Jan 2014 21:53:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7cJe-000330-OD for qemu-devel@nongnu.org; Sun, 26 Jan 2014 21:52:55 -0500 Received: from paradis.irqsave.net ([62.212.105.220]:48410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7cJe-00032w-Dz for qemu-devel@nongnu.org; Sun, 26 Jan 2014 21:52:50 -0500 Date: Mon, 27 Jan 2014 03:52:51 +0100 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140127025251.GC7415@irqsave.net> References: <1390762963-25538-1-git-send-email-mreitz@redhat.com> <1390762963-25538-5-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1390762963-25538-5-git-send-email-mreitz@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 04/10] block: Reuse NULL options check from bdrv_open() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi Le Sunday 26 Jan 2014 =E0 20:02:37 (+0100), Max Reitz a =E9crit : > Remove the check whether options is NULL form bdrv_file_open() and rely s/form/for/g ? > on the one in bdrv_open() instead. >=20 > Signed-off-by: Max Reitz > --- > block.c | 15 +++++---------- > 1 file changed, 5 insertions(+), 10 deletions(-) >=20 > diff --git a/block.c b/block.c > index 0fb7892..c7219cb 100644 > --- a/block.c > +++ b/block.c > @@ -958,11 +958,6 @@ static int bdrv_file_open(BlockDriverState **pbs, = const char *filename, > Error *local_err =3D NULL; > int ret; > =20 > - /* NULL means an empty set of options */ > - if (options =3D=3D NULL) { > - options =3D qdict_new(); > - } > - > if (reference) { > if (filename || qdict_size(options)) { > error_setg(errp, "Cannot reference an existing block devic= e with " > @@ -1228,17 +1223,17 @@ int bdrv_open(BlockDriverState **pbs, const cha= r *filename, > const char *drvname; > Error *local_err =3D NULL; > =20 > + /* NULL means an empty set of options */ > + if (options =3D=3D NULL) { > + options =3D qdict_new(); > + } > + > if (flags & BDRV_O_PROTOCOL) { > assert(!drv); > return bdrv_file_open(pbs, filename, reference, options, > flags & ~BDRV_O_PROTOCOL, errp); > } > =20 > - /* NULL means an empty set of options */ > - if (options =3D=3D NULL) { > - options =3D qdict_new(); > - } > - > if (reference) { > bool options_non_empty =3D qdict_size(options); > QDECREF(options); > --=20 > 1.8.5.3 >=20 >=20 Reviewed-by: Benoit Canet