From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVBhu-0004ms-2S for qemu-devel@nongnu.org; Wed, 24 Apr 2013 22:14:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVBht-0002Gm-31 for qemu-devel@nongnu.org; Wed, 24 Apr 2013 22:14:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4002) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVBhs-0002Gh-Rg for qemu-devel@nongnu.org; Wed, 24 Apr 2013 22:14:45 -0400 Date: Wed, 24 Apr 2013 22:14:41 -0400 From: Luiz Capitulino Message-ID: <20130424221441.23313226@redhat.com> In-Reply-To: <51788A85.20500@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=US-ASCII Content-Transfer-Encoding: 7bit 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, Amos Kong , qemu-devel@nongnu.org, jyang@redhat.com On Wed, 24 Apr 2013 19:44:37 -0600 Eric Blake wrote: > On 04/24/2013 07:35 PM, Luiz Capitulino wrote: > > >> case QEMU_OPT_SIZE: > >> param_info->type = CONFIG_PARAM_TYPE_SIZE; > >> break; > >> } > > > > Looks good. > > > >> I think we don't need default here, until some add new items in enum > >> QemuOptType without update this code. > > > > Maybe we can have: > > > > default: > > abort(); > > > > So that we catch new QEmuOpts types not accompanied by a new ConfigParamType > > type. > > gcc is able to warn about missed options if you omit a default case (and > 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 been > switching to default-free coding styles on any switch statement where we > expect an enum will grow in the future, for that reason. Ah, didn't know that. Fine with me then.