[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v2 12/16] block/mirror: Distinguish active from pass
From: |
Max Reitz |
Subject: |
[Qemu-block] [PATCH v2 12/16] block/mirror: Distinguish active from passive ops |
Date: |
Mon, 22 Jan 2018 23:08:02 +0100 |
Currently, the mirror block job only knows passive operations. But once
we introduce active writes, we need to distinguish between the two; for
example, mirror_wait_for_free_in_flight_slot() should wait for a passive
operation because active writes will not use the same in-flight slots.
Signed-off-by: Max Reitz <address@hidden>
---
block/mirror.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/block/mirror.c b/block/mirror.c
index 2363e79563..bb46f3c4e9 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -89,6 +89,7 @@ struct MirrorOp {
int64_t *bytes_handled;
bool is_pseudo_op;
+ bool is_active_write;
CoQueue waiting_requests;
QTAILQ_ENTRY(MirrorOp) next;
@@ -281,8 +282,10 @@ static inline void
mirror_wait_for_free_in_flight_slot(MirrorBlockJob *s)
* some other operation to start, which may in fact be the
* caller of this function. Since there is only one pseudo op
* at any given time, we will always find some real operation
- * to wait on. */
- if (!op->is_pseudo_op) {
+ * to wait on.
+ * Also, only non-active operations use up in-flight slots, so
+ * we can ignore active operations. */
+ if (!op->is_pseudo_op && !op->is_active_write) {
qemu_co_queue_wait(&op->waiting_requests, NULL);
return;
}
--
2.14.3
- [Qemu-block] [PATCH v2 02/16] block: BDS deletion in bdrv_do_drained_begin(), (continued)
- [Qemu-block] [PATCH v2 02/16] block: BDS deletion in bdrv_do_drained_begin(), Max Reitz, 2018/01/22
- [Qemu-block] [PATCH v2 03/16] tests: Add bdrv-drain test for node deletion, Max Reitz, 2018/01/22
- [Qemu-block] [PATCH v2 04/16] block/mirror: Pull out mirror_perform(), Max Reitz, 2018/01/22
- [Qemu-block] [PATCH v2 05/16] block/mirror: Convert to coroutines, Max Reitz, 2018/01/22
- [Qemu-block] [PATCH v2 06/16] block/mirror: Use CoQueue to wait on in-flight ops, Max Reitz, 2018/01/22
- [Qemu-block] [PATCH v2 07/16] block/mirror: Wait for in-flight op conflicts, Max Reitz, 2018/01/22
- [Qemu-block] [PATCH v2 08/16] block/mirror: Use source as a BdrvChild, Max Reitz, 2018/01/22
- [Qemu-block] [PATCH v2 09/16] block: Generalize should_update_child() rule, Max Reitz, 2018/01/22
- [Qemu-block] [PATCH v2 10/16] hbitmap: Add @advance param to hbitmap_iter_next(), Max Reitz, 2018/01/22
- [Qemu-block] [PATCH v2 11/16] block/dirty-bitmap: Add bdrv_dirty_iter_next_area, Max Reitz, 2018/01/22
- [Qemu-block] [PATCH v2 12/16] block/mirror: Distinguish active from passive ops,
Max Reitz <=
- [Qemu-block] [PATCH v2 13/16] block/mirror: Add MirrorBDSOpaque, Max Reitz, 2018/01/22
- [Qemu-block] [PATCH v2 14/16] block/mirror: Add active mirroring, Max Reitz, 2018/01/22
- [Qemu-block] [PATCH v2 15/16] block/mirror: Add copy mode QAPI interface, Max Reitz, 2018/01/22
- [Qemu-block] [PATCH v2 16/16] iotests: Add test for active mirroring, Max Reitz, 2018/01/22