qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] monitor: introduce query-config-schema command


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] monitor: introduce query-config-schema command
Date: Wed, 24 Apr 2013 19:44:37 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5

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.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]