@@ -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;
}
@@ -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()) {
@@ -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
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 <mreitz@redhat.com> --- block.c | 2 +- blockjob.c | 3 +-- include/block/block_int.h | 4 ---- 3 files changed, 2 insertions(+), 7 deletions(-)