Received: from eggs.gnu.org ([208.118.235.92]:59688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVBWm-0001Mu-2T for qemu-devel@nongnu.org; Wed, 24 Apr 2013 22:03:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVBWh-0007Lm-Dj for qemu-devel@nongnu.org; Wed, 24 Apr 2013 22:03:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27805) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVBWh-0007LS-4g for qemu-devel@nongnu.org; Wed, 24 Apr 2013 22:03:11 -0400 Date: Thu, 25 Apr 2013 10:03:08 +0800 From: Amos Kong Message-ID: <20130425020308.GD3230@t430s.nay.redhat.com> References: <1366807646-8473-2-git-send-email-akong@redhat.com> <1366824804-24532-1-git-send-email-akong@redhat.com> <20130424142020.4e6a54a1@redhat.com> <20130425011451.GB3230@t430s.nay.redhat.com> <20130424213540.3a55cb5b@redhat.com> <51788A85.20500@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <51788A85.20500@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] monitor: introduce query-config-schema command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, jyang@redhat.com, Luiz Capitulino On Wed, Apr 24, 2013 at 07:44:37PM -0600, Eric Blake wrote: > On 04/24/2013 07:35 PM, Luiz Capitulino wrote: >=20 > >> case QEMU_OPT_SIZE: = =20 > >> param_info->type =3D CONFIG_PARAM_TYPE_SIZE= ; =20 > >> break; > >> } =20 > >=20 > > Looks good. > >=20 > >> I think we don't need default here, until some add new items in enum > >> QemuOptType without update this code. > >=20 > > Maybe we can have: > >=20 > > default: > > abort(); > >=20 > > So that we catch new QEmuOpts types not accompanied by a new ConfigPa= ramType > > type. >=20 > gcc is able to warn about missed options if you omit a default case (an= d > if the switch was on an actual enum type); but does not warn about > missed options if you do have a default case. Libvirt has actually bee= n > switching to default-free coding styles on any switch statement where w= e > expect an enum will grow in the future, for that reason. util/qemu-config.c: In function =E2=80=98qmp_query_command_line_options=E2= =80=99: util/qemu-config.c:60:17: error: enumeration value =E2=80=98QEMU_OPT_NEW=E2= =80=99 not handled in switch [-Werror=3Dswitch] cc1: all warnings being treated as errors Good! no need default case here. --=20 Amos.