qemu-devel
[Top][All Lists]
Advanced

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

[PATCH 1/2] When del child, next_child_index need to subtract 1. Otherwi


From: quweijie
Subject: [PATCH 1/2] When del child, next_child_index need to subtract 1. Otherwise, the index will get bigger and bigger.
Date: Mon, 11 May 2020 18:00:30 +0800

From: quweijie <address@hidden>

Signed-off-by: quweijie <address@hidden>
---
 block/quorum.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block/quorum.c b/block/quorum.c
index 6d7a56b..a8272fe 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -1096,6 +1096,7 @@ static void quorum_del_child(BlockDriverState *bs, 
BdrvChild *child,
     memmove(&s->children[i], &s->children[i + 1],
             (s->num_children - i - 1) * sizeof(BdrvChild *));
     s->children = g_renew(BdrvChild *, s->children, --s->num_children);
+    s->next_child_index--;
     bdrv_unref_child(bs, child);
 
     bdrv_drained_end(bs);
-- 
1.8.3.1




reply via email to

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