[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 15/53] block.c: Fix type of IoOperationType variable
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 15/53] block.c: Fix type of IoOperationType variable in send_qmp_error_event() |
Date: |
Mon, 3 Nov 2014 11:50:18 +0000 |
From: Peter Maydell <address@hidden>
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>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
block.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/block.c b/block.c
index 4179341..13a9e51 100644
--- a/block.c
+++ b/block.c
@@ -3544,10 +3544,10 @@ static void send_qmp_error_event(BlockDriverState *bs,
BlockErrorAction action,
bool is_read, int error)
{
- BlockErrorAction ac;
+ IoOperationType optype;
- ac = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE;
- qapi_event_send_block_io_error(bdrv_get_device_name(bs), ac, action,
+ optype = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE;
+ qapi_event_send_block_io_error(bdrv_get_device_name(bs), optype, action,
bdrv_iostatus_is_enabled(bs),
error == ENOSPC, strerror(error),
&error_abort);
--
1.9.3
- [Qemu-devel] [PULL 05/53] block/iscsi: use sector_limits_lun2qemu throughout iscsi_refresh_limits, (continued)
- [Qemu-devel] [PULL 05/53] block/iscsi: use sector_limits_lun2qemu throughout iscsi_refresh_limits, Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 06/53] block/iscsi: check for oversized requests, Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 07/53] ahci: Correct PIO/D2H FIS responses, Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 08/53] ahci: Update byte count after DMA completion, Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 09/53] ahci: Fix SDB FIS Construction, Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 10/53] snapshot: Reset err to NULL to avoid double free, Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 11/53] iotests: replace fake parallels image with authentic one, Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 12/53] iotests: add v2 parallels sample image and simple test for it, Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 13/53] block/parallels: fix access to not initialized memory in catalog_bitmap, Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 14/53] rbd: Add support for bdrv_invalidate_cache, Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 15/53] block.c: Fix type of IoOperationType variable in send_qmp_error_event(),
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 17/53] block/curl: Improve type safety of s->timeout., Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 16/53] snapshot: add bdrv_drain_all() to bdrv_snapshot_delete() to avoid concurrency problem, Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 18/53] raw-posix: Fix raw_co_get_block_status() after EOF, Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 19/53] raw-posix: raw_co_get_block_status() return value, Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 20/53] iotests: Add test for external image truncation, Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 21/53] qcow2: Allow "full" discard, Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 22/53] qcow2: Implement bdrv_make_empty(), Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 23/53] qcow2: Optimize bdrv_make_empty(), Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 24/53] blockjob: Introduce block_job_complete_sync(), Stefan Hajnoczi, 2014/11/03
- [Qemu-devel] [PULL 26/53] iotests: Omit length/offset test in 040 and 041, Stefan Hajnoczi, 2014/11/03