Commit 0bf35a66b6 for qemu.org
commit 0bf35a66b69a12f0e8d8a0f3f534a1ff9f52aa51
Author: Denis V. Lunev <den@openvz.org>
Date: Thu Nov 5 21:37:52 2026 +0100
block: notify only the replaced child in bdrv_replace_child_bs()
bdrv_replace_child_bs() compares the sizes of the old and the new node
to decide whether @child has to be told, and then notifies every parent
of new_bs. The other parents already had that node and its size, so
they get a resize event for nothing: a scsi-hd sharing the new node
reports CAPACITY DATA HAS CHANGED to its guest although the capacity is
the same.
Notify @child alone. bdrv_parent_cb_resize() has no user left, so drop
it.
Fixes: 8b267376df87 ("block: notify the parent when a replaced child has a different size")
Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-ID: <20261105203752.3169635-4-den@openvz.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
diff --git a/block.c b/block.c
index 9df1a48c06..c3e7059556 100644
--- a/block.c
+++ b/block.c
@@ -5590,7 +5590,7 @@ int bdrv_replace_child_bs(BdrvChild *child, BlockDriverState *new_bs,
int64_t new_len = bdrv_getlength(new_bs);
if (new_len >= 0 && new_len != old_len) {
- bdrv_parent_cb_resize(new_bs);
+ bdrv_child_notify_resize(child);
}
}
diff --git a/include/block/block_int-io.h b/include/block/block_int-io.h
index 3cb72fecd4..6aa7b2184e 100644
--- a/include/block/block_int-io.h
+++ b/include/block/block_int-io.h
@@ -206,7 +206,4 @@ bdrv_co_child_notify_resize(BdrvChild *c);
void co_wrapper_bdrv_rdlock
bdrv_child_notify_resize(BdrvChild *c);
-void co_wrapper_bdrv_rdlock
-bdrv_parent_cb_resize(BlockDriverState *bs);
-
#endif /* BLOCK_INT_IO_H */