[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] block.c: Fix type of IoOperationType variable i
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] block.c: Fix type of IoOperationType variable in send_qmp_error_event() |
Date: |
Fri, 10 Oct 2014 13:40:54 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 |
On 10/10/2014 01:33 PM, Peter Maydell wrote:
> The local variable 'ac' in send_qmp_error_event() is declared with the
> wrong type, which causes clang to complain when it is initialized
> and again when it is used:
>
> block.c:3655:20: warning: implicit conversion from enumeration type 'enum
> IoOperationType' to different enumeration type 'BlockErrorAction' (aka 'enum
> BlockErrorAction') [-Wenum-conversion]
> ac = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE;
> ~ ^~~~~~~~~~~~~~~~~~~~~~
> block.c:3655:45: warning: implicit conversion from enumeration type 'enum
> IoOperationType' to different enumeration type 'BlockErrorAction' (aka 'enum
> BlockErrorAction') [-Wenum-conversion]
> ac = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE;
> ~ ^~~~~~~~~~~~~~~~~~~~~~~
> block.c:3656:62: warning: implicit conversion from enumeration type
> 'BlockErrorAction' (aka 'enum BlockErrorAction') to different enumeration
> type 'IoOperationType' (aka 'enum IoOperationType') [-Wenum-conversion]
> qapi_event_send_block_io_error(bdrv_get_device_name(bs), ac, action,
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~
>
> Correct the type to IoOperationType, and rename the variable
> to 'optype' to match its correct type.
>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> Bug introduced when this code was pulled out into its
> own function in commit c7c2ff0c7e5d2c04.
>
> block.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature