[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 04/15] block: Don't attach inactive child to active node
From: |
Kevin Wolf |
Subject: |
[PATCH v2 04/15] block: Don't attach inactive child to active node |
Date: |
Thu, 30 Jan 2025 18:12:35 +0100 |
An active node makes unrestricted use of its children and would possibly
run into assertion failures when it operates on an inactive child node.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/block.c b/block.c
index f60606f242..94368a200e 100644
--- a/block.c
+++ b/block.c
@@ -3183,6 +3183,11 @@ bdrv_attach_child_noperm(BlockDriverState *parent_bs,
child_bs->node_name, child_name, parent_bs->node_name);
return NULL;
}
+ if (bdrv_is_inactive(child_bs) && !bdrv_is_inactive(parent_bs)) {
+ error_setg(errp, "Inactive '%s' can't be a %s child of active '%s'",
+ child_bs->node_name, child_name, parent_bs->node_name);
+ return NULL;
+ }
bdrv_get_cumulative_perm(parent_bs, &perm, &shared_perm);
bdrv_child_perm(parent_bs, child_bs, NULL, child_role, NULL,
--
2.48.1
- [PATCH v2 00/15] block: Managing inactive nodes (QSD migration), Kevin Wolf, 2025/01/30
- [PATCH v2 01/15] block: Add 'active' field to BlockDeviceInfo, Kevin Wolf, 2025/01/30
- [PATCH v2 02/15] block: Inactivate external snapshot overlays when necessary, Kevin Wolf, 2025/01/30
- [PATCH v2 03/15] migration/block-active: Remove global active flag, Kevin Wolf, 2025/01/30
- [PATCH v2 04/15] block: Don't attach inactive child to active node,
Kevin Wolf <=
- [PATCH v2 06/15] block: Fix crash on block_resize on inactive node, Kevin Wolf, 2025/01/30
- [PATCH v2 05/15] block: Allow inactivating already inactive nodes, Kevin Wolf, 2025/01/30
- [PATCH v2 07/15] block: Add option to create inactive nodes, Kevin Wolf, 2025/01/30
- [PATCH v2 08/15] block: Add blockdev-set-active QMP command, Kevin Wolf, 2025/01/30
- [PATCH v2 09/15] block: Support inactive nodes in blk_insert_bs(), Kevin Wolf, 2025/01/30