Skip to contentSkip to conversation

block: fix implicit convertion to invalid type

PATCH Superseded Igor Mammedov 3 participants 4 messages Oct 16, 2014 – Oct 28, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: fix implicit convertion to invalid type

change type of variable to expected IoOperationType which fixes compile warning:

block.c:3655:20: warning: implicit conversion from enumeration
type enum IoOperationType to different enumeration type BlockErrorAction

---
 block.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
block.c +3 -3
index 27533f3..c15fad0 100644
@@ -3650,10 +3650,10 @@ static void send_qmp_error_event(BlockDriverState *bs,
                                  BlockErrorAction action,
                                  bool is_read, int error)
 {
-    BlockErrorAction ac;
+    IoOperationType op;
 
-    ac = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE;
-    qapi_event_send_block_io_error(bdrv_get_device_name(bs), ac, action,
+    op = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE;
+    qapi_event_send_block_io_error(bdrv_get_device_name(bs), op, action,
                                    bdrv_iostatus_is_enabled(bs),
                                    error == ENOSPC, strerror(error),
                                    &error_abort);
Signature · 1 line
1.9.3 (Apple Git-50)
Reviewed-by on v1 1/1
#1 lore raw

Am 16.10.2014 um 14:10 schrieb Igor Mammedov:

Quoted 10 lines

change type of variable to expected IoOperationType which fixes compile warning:

block.c:3655:20: warning: implicit conversion from enumeration
type enum IoOperationType to different enumeration type BlockErrorAction

---
  block.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
#2 lore raw

Am 16.10.2014 um 15:34 schrieb Max Reitz:

Quoted 8 lines

Am 16.10.2014 um 14:10 schrieb Igor Mammedov:

Quoted 7 lines

change type of variable to expected IoOperationType which fixes compile warning:

block.c:3655:20: warning: implicit conversion from enumeration
type enum IoOperationType to different enumeration type
BlockErrorAction

Quoted 6 lines
Quoted 4 lines
---
  block.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

Oh, I had the feeling I was forgetting something. The subject should read "conversion", not "convertion". Feel free to keep my R-b if you send a v2 to fix it.

Max

#3 lore raw
In reply to Igor Mammedov
Quoted 10 lines · Igor Mammedov

change type of variable to expected IoOperationType which fixes compile warning:

block.c:3655:20: warning: implicit conversion from enumeration
type enum IoOperationType to different enumeration type BlockErrorAction

---
 block.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Thanks Igor. Peter Maydell already sent a fix "block.c: Fix type of IoOperationType variable in send_qmp_error_event()".

Stefan