Re: [libvirt] [PATCH v2 02/42] util: handle missing switch enum cases

2018-02-20 Thread Daniel P . Berrangé
On Tue, Feb 20, 2018 at 01:05:23PM +0100, Andrea Bolognani wrote: > On Tue, 2018-02-20 at 11:25 +, Daniel P. Berrangé wrote: > > > Yesterday I argued in a different thread that it would be better > > > to include the enum name in the error message, since that's useful > > > information for

Re: [libvirt] [PATCH v2 02/42] util: handle missing switch enum cases

2018-02-20 Thread Andrea Bolognani
On Tue, 2018-02-20 at 11:25 +, Daniel P. Berrangé wrote: > > Yesterday I argued in a different thread that it would be better > > to include the enum name in the error message, since that's useful > > information for developers whereas users 1) should never see this > > kind of error to begin

Re: [libvirt] [PATCH v2 02/42] util: handle missing switch enum cases

2018-02-20 Thread John Ferlan
On 02/20/2018 06:25 AM, Daniel P. Berrangé wrote: > On Tue, Feb 20, 2018 at 12:19:15PM +0100, Andrea Bolognani wrote: >> On Tue, 2018-02-20 at 09:54 +, Daniel P. Berrangé wrote: > +case VIR_CONF_LAST: > default: > +

Re: [libvirt] [PATCH v2 02/42] util: handle missing switch enum cases

2018-02-20 Thread Daniel P . Berrangé
On Tue, Feb 20, 2018 at 12:19:15PM +0100, Andrea Bolognani wrote: > On Tue, 2018-02-20 at 09:54 +, Daniel P. Berrangé wrote: > > > > +case VIR_CONF_LAST: > > > > default: > > > > +virReportError(VIR_ERR_INTERNAL_ERROR, > > > > +

Re: [libvirt] [PATCH v2 02/42] util: handle missing switch enum cases

2018-02-20 Thread Andrea Bolognani
On Tue, 2018-02-20 at 09:54 +, Daniel P. Berrangé wrote: > > > +case VIR_CONF_LAST: > > > default: > > > +virReportError(VIR_ERR_INTERNAL_ERROR, > > > + _("Unexpected conf value type %d"), > > > val->type); > > > return -1; > >

Re: [libvirt] [PATCH v2 02/42] util: handle missing switch enum cases

2018-02-20 Thread Daniel P . Berrangé
On Tue, Feb 20, 2018 at 10:49:29AM +0100, Ján Tomko wrote: > On Thu, Feb 15, 2018 at 04:43:07PM +, Daniel P. Berrangé wrote: > > Ensure all enum cases are listed in switch statements. > > > > Signed-off-by: Daniel P. Berrangé > > --- > > src/util/virconf.c

Re: [libvirt] [PATCH v2 02/42] util: handle missing switch enum cases

2018-02-20 Thread Ján Tomko
On Thu, Feb 15, 2018 at 04:43:07PM +, Daniel P. Berrangé wrote: Ensure all enum cases are listed in switch statements. Signed-off-by: Daniel P. Berrangé --- src/util/virconf.c | 13 - src/util/virfirewall.c | 7 +--

Re: [libvirt] [PATCH v2 02/42] util: handle missing switch enum cases

2018-02-19 Thread John Ferlan
On 02/15/2018 11:43 AM, Daniel P. Berrangé wrote: > Ensure all enum cases are listed in switch statements. and in some cases force an error if something unexpected is found. [not necessary to add, especially since it's repeatable throughout the series so far, but figured I'd note it at least