On Thu, Apr 14, 2016 at 05:52:30PM +0200, Peter Krempa wrote:
> Arrays would induce crash if a new value was introduced without adding
> it here. This could happen for
> VIR_DOMAIN_EVENT_DISK_DROP_MISSING_ON_START
> ---
>  examples/object-events/event-test.c | 37 
> ++++++++++++++++++++++++++++---------
>  1 file changed, 28 insertions(+), 9 deletions(-)
> 

> +static const char *
> +diskChangeReasonToStr(int reason)

diskChangeReasonToString would looks nicer, but Str is readable enough,
thanks to all the std funcs in libc.

ACK

Jan

> +{
> +    switch ((virConnectDomainEventDiskChangeReason) reason) {
> +    case VIR_DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START:
> +        return "disk empty due to startupPolicy";
> +
> +    case VIR_DOMAIN_EVENT_DISK_DROP_MISSING_ON_START:
> +        return "disk dropped due to startupPolicy";
> +    }
> +
> +    return "unknown";
> +}
> +

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to