qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 11/17] mirror: Inline mirror_write_complete(), part


From: Max Reitz
Subject: [Qemu-devel] [PATCH 11/17] mirror: Inline mirror_write_complete(), part 1
Date: Mon, 13 Aug 2018 04:20:00 +0200

Eventually, we want to inline mirror_write_complete() fully into
mirror_co_perform().  This patch does the inlining, but we cannot remove
the function yet, as it is still required by mirror_co_read().

Signed-off-by: Max Reitz <address@hidden>
---
 block/mirror.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/block/mirror.c b/block/mirror.c
index 2a131d8b99..66746cf075 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -407,7 +407,17 @@ static void coroutine_fn mirror_co_perform(void *opaque)
         abort();
     }
 
-    mirror_write_complete(op, ret);
+    if (ret < 0) {
+        BlockErrorAction action;
+
+        bdrv_set_dirty_bitmap(s->dirty_bitmap, op->offset, op->bytes);
+        action = mirror_error_action(s, false, -ret);
+        if (action == BLOCK_ERROR_ACTION_REPORT && s->ret >= 0) {
+            s->ret = ret;
+        }
+    }
+
+    mirror_iteration_done(op, ret);
 
 done:
     aio_context_release(aio_context);
-- 
2.17.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]