On Tue, Feb 20, 2018 at 01:44:31PM -0500, John Ferlan wrote:
On 02/20/2018 12:08 PM, Daniel P. Berrangé wrote:
> Ensure all enum cases are listed in switch statements.
>
> Reviewed-by: John Ferlan <jferlan(a)redhat.com>
> Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
> ---
> src/util/virconf.c | 11 ++++++++++-
> src/util/virfirewall.c | 6 ++++--
> src/util/virlog.c | 9 ++++++++-
> src/util/virnetdevvportprofile.c | 10 +++++++++-
> 4 files changed, 31 insertions(+), 5 deletions(-)
>
[...]
> diff --git a/src/util/virlog.c b/src/util/virlog.c
> index 4f66cc5e5c..6c6d7e8ded 100644
> --- a/src/util/virlog.c
> +++ b/src/util/virlog.c
> @@ -1206,10 +1206,17 @@ virLogGetOutputs(void)
> virLogDestinationTypeToString(dest),
> virLogOutputs[i]->name);
> break;
> - default:
> + case VIR_LOG_TO_STDERR:
> + case VIR_LOG_TO_JOURNALD:
> virBufferAsprintf(&outputbuf, "%d:%s",
> virLogOutputs[i]->priority,
> virLogDestinationTypeToString(dest));
> + break;
> + case VIR_LOG_TO_OUTPUT_LAST:
> + default:
> + virReportEnumRangeError(virLogDestination, dest);
Didn't see this before, but because this is a for loop, you'll need to
add a virBufferFreeAndReset(&outputbuf); before returning.
Ok
Regards,
Daniel
--
|:
https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|:
https://libvirt.org -o-
https://fstop138.berrange.com :|
|:
https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|