Re: [PATCH 1/3] qemu: simplify switch case for blockjob events

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

 



On Wed, Oct 05, 2016 at 16:52:08 +0300, Nikolay Shirokovskiy wrote:
> ---
>  src/qemu/qemu_monitor_json.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
> index e1494df..6c2884d 100644
> --- a/src/qemu/qemu_monitor_json.c
> +++ b/src/qemu/qemu_monitor_json.c
> @@ -841,10 +841,8 @@ qemuMonitorJSONHandleBlockJobImpl(qemuMonitorPtr mon,
>      case VIR_DOMAIN_BLOCK_JOB_CANCELED:
>      case VIR_DOMAIN_BLOCK_JOB_READY:
>          break;
> -    case VIR_DOMAIN_BLOCK_JOB_FAILED:
> -    case VIR_DOMAIN_BLOCK_JOB_LAST:
> -        VIR_DEBUG("should not get here");
> -        break;
> +    default:
> +        VIR_WARN("unexpected block job type: %d", event);
>      }

NACK, we intentionally don't use default branches. Default switch
branch disables GCC warnings in case any enum item is not handled.

Runtime warnings are invisible while compile time warnings are very easy
to spot.

Jirka

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]