Skip to contentSkip to conversation

block: changed to proper enum type

PATCH In review SeokYeon Hwang 3 participants 3 messages Oct 31, 2014 – Nov 3, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: changed to proper enum type

To fix compiler warning on clang > 3.4, changed to proper enum type.

---
 block.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
block.c +3 -3
index 88f6d9b..50845a4 100644
@@ -3540,10 +3540,10 @@ static void send_qmp_error_event(BlockDriverState *bs,
                                  BlockErrorAction action,
                                  bool is_read, int error)
 {
-    BlockErrorAction ac;
+    IoOperationType operation;
 
-    ac = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE;
-    qapi_event_send_block_io_error(bdrv_get_device_name(bs), ac, action,
+    operation = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE;
+    qapi_event_send_block_io_error(bdrv_get_device_name(bs), operation, action,
                                    bdrv_iostatus_is_enabled(bs),
                                    error == ENOSPC, strerror(error),
                                    &error_abort);
Signature · 1 line
2.1.0
#1 lore raw
Quoted 15 lines · SeokYeon Hwang

To fix compiler warning on clang > 3.4, changed to proper enum type.

---
  block.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
block.c +0 -0
index 88f6d9b..50845a4 100644
@@ -3540,10 +3540,10 @@ static void send_qmp_error_event(BlockDriverState *bs,
                                   BlockErrorAction action,
                                   bool is_read, int error)
  {

block.c static void send_qmp_error_event(BlockDriverState *bs, · line 3549

Quoted 10 lines
block.c +3 -3
-    BlockErrorAction ac;
+    IoOperationType operation;
 
-    ac = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE;
-    qapi_event_send_block_io_error(bdrv_get_device_name(bs), ac, action,
+    operation = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE;
+    qapi_event_send_block_io_error(bdrv_get_device_name(bs), operation, action,
                                     bdrv_iostatus_is_enabled(bs),
                                     error == ENOSPC, strerror(error),
                                     &error_abort);

Hi,

thank you for this patch, but the reason I did not review it is because there were already a couple of these on the mailing list, and Stefan already merged one of them to his block tree; see: http://lists.nongnu.org/archive/cgi-bin/namazu.cgi?query=BlockErrorAction+IoOperationType&submit=Search!&idxname=qemu-devel&max=20&result=normal&sort=score

The patch Stefan merged is here: https://github.com/stefanha/qemu/commit/eaedb4cb2706a0ad4698d556aa2a8b091962d545

Max

#2 lore raw
In reply to SeokYeon Hwang
Quoted 16 lines · SeokYeon Hwang

To fix compiler warning on clang > 3.4, changed to proper enum type.

---
 block.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
block.c +0 -0
index 88f6d9b..50845a4 100644
@@ -3540,10 +3540,10 @@ static void send_qmp_error_event(BlockDriverState *bs,
                                  BlockErrorAction action,
                                  bool is_read, int error)
 {

block.c static void send_qmp_error_event(BlockDriverState *bs, · line 3549

Quoted 10 lines
block.c +3 -3
-    BlockErrorAction ac;
+    IoOperationType operation;
 
-    ac = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE;
-    qapi_event_send_block_io_error(bdrv_get_device_name(bs), ac, action,
+    operation = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE;
+    qapi_event_send_block_io_error(bdrv_get_device_name(bs), operation, action,
                                    bdrv_iostatus_is_enabled(bs),
                                    error == ENOSPC, strerror(error),
                                    &error_abort);

Hi, I think a similar patch has already been posted.

Paolo