From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxT7J-0002F8-0B for qemu-devel@nongnu.org; Wed, 18 Jun 2014 23:34:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxT7E-0005qm-JC for qemu-devel@nongnu.org; Wed, 18 Jun 2014 23:34:24 -0400 Received: from mail-wg0-x22b.google.com ([2a00:1450:400c:c00::22b]:51742) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxT7E-0005qK-Bk for qemu-devel@nongnu.org; Wed, 18 Jun 2014 23:34:20 -0400 Received: by mail-wg0-f43.google.com with SMTP id b13so1687716wgh.14 for ; Wed, 18 Jun 2014 20:34:19 -0700 (PDT) Date: Thu, 19 Jun 2014 11:34:11 +0800 From: Stefan Hajnoczi Message-ID: <20140619033411.GB21236@stefanha-thinkpad.redhat.com> References: <1403059646-4161-1-git-send-email-cyliu@suse.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eAbsdosE1cNLO4uF" Content-Disposition: inline In-Reply-To: <1403059646-4161-1-git-send-email-cyliu@suse.com> Subject: Re: [Qemu-devel] [PATCH] check NULL opts in qemu_opt_get functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chunyan Liu Cc: qemu-devel@nongnu.org, stefanha@redhat.com --eAbsdosE1cNLO4uF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 18, 2014 at 10:47:26AM +0800, Chunyan Liu wrote: > Some places will call bdrv_create_file(filename, NULL, &local_err), where > opts is NULL. Check NULL in qemu_opt_get and qemu_opt_get_*_del functions, > to avoid extra effort of checking opts before calling them every time. >=20 > Signed-off-by: Chunyan Liu > --- > Fix reported bugs: > http://lists.gnu.org/archive/html/qemu-devel/2014-06/msg03866.html >=20 > --- > util/qemu-option.c | 28 ++++++++++++++++++++++++---- > 1 file changed, 24 insertions(+), 4 deletions(-) A subset of QemuOpts functions access NULL opts while others do not, but that was already the case before this patch. So this patch looks good to me. Thanks, applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan --eAbsdosE1cNLO4uF Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJTolozAAoJEJykq7OBq3PIacYH/RcHk4CiFL+NxIPeRUhqrJHi yKsC3Tdxr8ThAnf5qtjMSqLAlO1c4EfLXFt0sYTdJb/Cx+wyDLfTMl1B6WyblKw+ R7rTFyFFzRINYSSbK2oUEcjIlr5ia1dVhY/IXVKCMZ2I+k7HqHnjeBMKXtw+BNKO N/CFf9asDfIUgIylTyikWZXq6ekNJaQ2XXOc2gXn/4K+Osb+jsEzsQTpfGU7FC0Z Pjdd6knwUA3jw+sAqtXud4EKPuevViVTl0F3c71LjxeeDSAlcpCEn8ada8GoWpg5 wWnbYM7UqulijqdEeq2CGysxoBWBMjAMxvexmcyk7Sfmh7PiC33fDwcolR/8www= =EBoc -----END PGP SIGNATURE----- --eAbsdosE1cNLO4uF--