diff options
author | Kevin Wolf <kwolf@redhat.com> | 2015-06-17 14:55:21 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2015-10-16 15:34:29 +0200 |
commit | 760e006384ecd5b8b8b1b91b5c85ff8fdcb3a21f (patch) | |
tree | 506ef3c27944a2f97069327493f875a2def3d90a /block/stream.c | |
parent | b26e90f56ad3a494ee6337d2075f4dc55b62b3c6 (diff) | |
download | qemu-760e006384ecd5b8b8b1b91b5c85ff8fdcb3a21f.zip qemu-760e006384ecd5b8b8b1b91b5c85ff8fdcb3a21f.tar.gz qemu-760e006384ecd5b8b8b1b91b5c85ff8fdcb3a21f.tar.bz2 |
block: Convert bs->backing_hd to BdrvChild
This is the final step in converting all of the BlockDriverState
pointers that block drivers use to BdrvChild.
After this patch, bs->children contains the full list of child nodes
that are referenced by a given BDS, and these children are only
referenced through BdrvChild, so that updating the pointer in there is
enough for changing edges in the graph.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/stream.c')
-rw-r--r-- | block/stream.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/block/stream.c b/block/stream.c index ab0bd05..ba535c5 100644 --- a/block/stream.c +++ b/block/stream.c @@ -56,7 +56,7 @@ static void close_unused_images(BlockDriverState *top, BlockDriverState *base, const char *base_id) { BlockDriverState *intermediate; - intermediate = top->backing_hd; + intermediate = backing_bs(top); /* Must assign before bdrv_delete() to prevent traversing dangling pointer * while we delete backing image instances. @@ -72,7 +72,7 @@ static void close_unused_images(BlockDriverState *top, BlockDriverState *base, } unused = intermediate; - intermediate = intermediate->backing_hd; + intermediate = backing_bs(intermediate); bdrv_set_backing_hd(unused, NULL); bdrv_unref(unused); } @@ -121,7 +121,7 @@ static void coroutine_fn stream_run(void *opaque) int n = 0; void *buf; - if (!bs->backing_hd) { + if (!bs->backing) { block_job_completed(&s->common, 0); return; } @@ -166,7 +166,7 @@ wait: } else if (ret >= 0) { /* Copy if allocated in the intermediate images. Limit to the * known-unallocated area [sector_num, sector_num+n). */ - ret = bdrv_is_allocated_above(bs->backing_hd, base, + ret = bdrv_is_allocated_above(backing_bs(bs), base, sector_num, n, &n); /* Finish early if end of backing file has been reached */ |