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>
This commit is contained in:
Kevin Wolf 2015-06-17 14:55:21 +02:00
parent b26e90f56a
commit 760e006384
14 changed files with 115 additions and 109 deletions

View file

@ -2508,7 +2508,7 @@ void qmp_drive_backup(const char *device, const char *target,
/* See if we have a backing HD we can use to create our new image
* on top of. */
if (sync == MIRROR_SYNC_MODE_TOP) {
source = bs->backing_hd;
source = backing_bs(bs);
if (!source) {
sync = MIRROR_SYNC_MODE_FULL;
}
@ -2716,7 +2716,7 @@ void qmp_drive_mirror(const char *device, const char *target,
}
flags = bs->open_flags | BDRV_O_RDWR;
source = bs->backing_hd;
source = backing_bs(bs);
if (!source && sync == MIRROR_SYNC_MODE_TOP) {
sync = MIRROR_SYNC_MODE_FULL;
}