[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for-5.0 05/31] block: Drop BdrvChildClass.stay_at_node
From: |
Max Reitz |
Subject: |
[PATCH for-5.0 05/31] block: Drop BdrvChildClass.stay_at_node |
Date: |
Wed, 27 Nov 2019 14:15:58 +0100 |
This should better be in BdrvChildRole so that parents can decide when
to and when not to keep the child node fixed.
Signed-off-by: Max Reitz <address@hidden>
---
block.c | 2 +-
blockjob.c | 3 +--
include/block/block_int.h | 4 ----
3 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/block.c b/block.c
index 90974ae36b..6c50ad661e 100644
--- a/block.c
+++ b/block.c
@@ -4103,7 +4103,7 @@ static bool should_update_child(BdrvChild *c,
BlockDriverState *to)
GHashTable *found;
bool ret;
- if (c->klass->stay_at_node) {
+ if (c->role & BDRV_CHILD_STAY_AT_NODE) {
return false;
}
diff --git a/blockjob.c b/blockjob.c
index e7dbb4093a..f58356fb6c 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -170,7 +170,6 @@ static const BdrvChildClass child_job = {
.drained_end = child_job_drained_end,
.can_set_aio_ctx = child_job_can_set_aio_ctx,
.set_aio_ctx = child_job_set_aio_ctx,
- .stay_at_node = true,
};
void block_job_remove_all_bdrv(BlockJob *job)
@@ -217,7 +216,7 @@ int block_job_add_bdrv(BlockJob *job, const char *name,
BlockDriverState *bs,
if (job->job.aio_context != qemu_get_aio_context()) {
aio_context_release(job->job.aio_context);
}
- c = bdrv_root_attach_child(bs, name, &child_job, 0,
+ c = bdrv_root_attach_child(bs, name, &child_job, BDRV_CHILD_STAY_AT_NODE,
job->job.aio_context, perm, shared_perm, job,
errp);
if (job->job.aio_context != qemu_get_aio_context()) {
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 85cfa4b069..102ce7853e 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -660,10 +660,6 @@ typedef struct BdrvAioNotifier {
} BdrvAioNotifier;
struct BdrvChildClass {
- /* If true, bdrv_replace_node() doesn't change the node this BdrvChild
- * points to. */
- bool stay_at_node;
-
/* If true, the parent is a BlockDriverState and bdrv_next_all_states()
* will return it. This information is used for drain_all, where every node
* will be drained separately, so the drain only needs to be propagated to
--
2.23.0
- [PATCH for-5.0 00/31] block: Introduce real BdrvChildRole, Max Reitz, 2019/11/27
- [PATCH for-5.0 02/31] block: Add BdrvChildRole, Max Reitz, 2019/11/27
- [PATCH for-5.0 01/31] block: Rename BdrvChildRole to BdrvChildClass, Max Reitz, 2019/11/27
- [PATCH for-5.0 04/31] block: Pass BdrvChildRole to bdrv_child_perm(), Max Reitz, 2019/11/27
- [PATCH for-5.0 03/31] block: Add BdrvChildRole to BdrvChild, Max Reitz, 2019/11/27
- [PATCH for-5.0 06/31] block: Keep BDRV_O_NO_IO in *inherited_fmt_options, Max Reitz, 2019/11/27
- [PATCH for-5.0 05/31] block: Drop BdrvChildClass.stay_at_node,
Max Reitz <=
- [PATCH for-5.0 07/31] block: Pass BdrvChildRole to .inherit_options(), Max Reitz, 2019/11/27
- [PATCH for-5.0 08/31] block: Unify bdrv_*inherited_options(), Max Reitz, 2019/11/27
- [PATCH for-5.0 09/31] block: Unify bdrv_child_cb_attach(), Max Reitz, 2019/11/27
- [PATCH for-5.0 14/31] block: Pull out bdrv_default_perms_for_storage(), Max Reitz, 2019/11/27
- [PATCH for-5.0 11/31] block: Add child_of_bds, Max Reitz, 2019/11/27
- [PATCH for-5.0 15/31] block: Split bdrv_default_perms_for_storage(), Max Reitz, 2019/11/27
- [PATCH for-5.0 12/31] block: Distinguish paths in *_format_default_perms, Max Reitz, 2019/11/27
- [PATCH for-5.0 10/31] block: Unify bdrv_child_cb_detach(), Max Reitz, 2019/11/27
- [PATCH for-5.0 13/31] block: Pull out bdrv_default_perms_for_backing(), Max Reitz, 2019/11/27
- [PATCH for-5.0 17/31] raw-format: Split raw_read_options(), Max Reitz, 2019/11/27