From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDja3-0006h0-L5 for qemu-devel@nongnu.org; Wed, 12 Feb 2014 18:51:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDjZz-0001qh-7n for qemu-devel@nongnu.org; Wed, 12 Feb 2014 18:51:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2569) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDjZy-0001qa-Uh for qemu-devel@nongnu.org; Wed, 12 Feb 2014 18:50:59 -0500 Message-ID: <52FC08E0.7000306@redhat.com> Date: Wed, 12 Feb 2014 16:50:56 -0700 From: Eric Blake MIME-Version: 1.0 References: <1392186806-10418-1-git-send-email-cyliu@suse.com> <1392186806-10418-6-git-send-email-cyliu@suse.com> In-Reply-To: <1392186806-10418-6-git-send-email-cyliu@suse.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5H9FMfGxSdc36q2SUs4KkfIDT9rVi0bQi" Subject: Re: [Qemu-devel] [PATCH v20 05/26] remove assertion of qemu_opt_get functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chunyan Liu , qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --5H9FMfGxSdc36q2SUs4KkfIDT9rVi0bQi Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/11/2014 11:33 PM, Chunyan Liu wrote: > In qemu_opt_set functions, if desc doen't exist but opts_accepts_any is= true, it s/doen't/doesn't/ > won't report error, but can still alloc an opt for the option and save = it. > However, after that, when doing qemu_opt_get, this option could be foun= d in opts > but opt->desc is NULL. This is correct, should not be treated as error.= >=20 > This patch would fix vvfat issue after changing to QemuOpts. >=20 > Signed-off-by: Chunyan Liu > --- > util/qemu-option.c | 3 --- > 1 files changed, 0 insertions(+), 3 deletions(-) >=20 > diff --git a/util/qemu-option.c b/util/qemu-option.c > index 21699d0..c51c55d 100644 > --- a/util/qemu-option.c > +++ b/util/qemu-option.c > @@ -641,7 +641,6 @@ bool qemu_opt_get_bool(QemuOpts *opts, const char *= name, bool defval) > } > return defval; > } > - assert(opt->desc && opt->desc->type =3D=3D QEMU_OPT_BOOL); I'd still rather see: if (opt->desc) { assert(opt->desc->type =3D=3D QEMU_OPT_BOOL); } That is, weaken but don't eliminate the assertion. Same for the other two sites. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --5H9FMfGxSdc36q2SUs4KkfIDT9rVi0bQi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJS/AjgAAoJEKeha0olJ0NqvtkH/15j8B1RIn3gUySFUIa38+wJ kHyEyrO6hmNdB56l6zGVqu4PlRx33FP7euIfGwljtEtuUzsLxQVg4H3DFTMA7u2c ePtGT9dNO2BiajhkJUlLLx3iNQwu/3f4CWStmNS4/dTPZnetIrnnbTTiW/aDi8tI HiRKvR+Dzb0J832cMeWbPB6fmf0tnqSPw/shOnNA4y0xCKbn+hd68vSAN+L+23pB 0BHcoBgCwFM996M+H/Xif95xpy+0kTEYvxtQX0PUjoAJBCmPRRb5G3jyBL2lmCvT 5XEq1MBbp08OYW0xUflJ/RI4qThv1HRHXaLu+J5/fxDoQlXsdS+Ks8otMjruRUk= =VQOb -----END PGP SIGNATURE----- --5H9FMfGxSdc36q2SUs4KkfIDT9rVi0bQi--