[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] monitor: introduce query-config-schema command
From: |
Amos Kong |
Subject: |
Re: [Qemu-devel] [PATCH] monitor: introduce query-config-schema command |
Date: |
Thu, 25 Apr 2013 10:03:08 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Apr 24, 2013 at 07:44:37PM -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.
util/qemu-config.c: In function ‘qmp_query_command_line_options’:
util/qemu-config.c:60:17: error: enumeration value ‘QEMU_OPT_NEW’ not
handled in switch [-Werror=switch]
cc1: all warnings being treated as errors
Good! no need default case here.
--
Amos.
- Re: [Qemu-devel] [PATCH 2/2] monitor: introduce query-config-schema command, (continued)
- [Qemu-devel] [PATCH] monitor: introduce query-config-schema command, Amos Kong, 2013/04/24
- [Qemu-devel] [PATCH v2] monitor: introduce query-config-schema command, Amos Kong, 2013/04/24
- Re: [Qemu-devel] [PATCH] monitor: introduce query-config-schema command, Luiz Capitulino, 2013/04/24
- Re: [Qemu-devel] [PATCH] monitor: introduce query-config-schema command, Eric Blake, 2013/04/24
- Re: [Qemu-devel] [PATCH] monitor: introduce query-config-schema command, Eric Blake, 2013/04/24
- Re: [Qemu-devel] [PATCH] monitor: introduce query-config-schema command, Amos Kong, 2013/04/24
- Re: [Qemu-devel] [PATCH] monitor: introduce query-config-schema command, Amos Kong, 2013/04/24
- Re: [Qemu-devel] [PATCH] monitor: introduce query-config-schema command, Luiz Capitulino, 2013/04/24
- Re: [Qemu-devel] [PATCH] monitor: introduce query-config-schema command, Eric Blake, 2013/04/24
- Re: [Qemu-devel] [PATCH] monitor: introduce query-config-schema command,
Amos Kong <=
- Re: [Qemu-devel] [PATCH] monitor: introduce query-config-schema command, Luiz Capitulino, 2013/04/24
- Re: [Qemu-devel] [PATCH] monitor: introduce query-config-schema command, Eric Blake, 2013/04/24
- Re: [Qemu-devel] [PATCH] monitor: introduce query-config-schema command, Osier Yang, 2013/04/24
Re: [Qemu-devel] [RESEND PATCH 1/2] qapi: introduce strList and visit_type_strList(), Eric Blake, 2013/04/24
Re: [Qemu-devel] [RESEND PATCH 1/2] qapi: introduce strList and visit_type_strList(), Eric Blake, 2013/04/24