block: Add list of children to BlockDriverState
commit6e93e7c41fdfdee3068770cae79380e1d986b76a
authorKevin Wolf <kwolf@redhat.com>
Wed, 8 Apr 2015 11:49:41 +0000 (8 13:49 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 12 Jun 2015 15:04:59 +0000 (12 17:04 +0200)
tree87b7df9d7946ee05123f8edbb0f60f4ddc9e92ea
parentae81693004fd95f7013e42811944707a92948d9a
block: Add list of children to BlockDriverState

This allows iterating over all children of a given BDS, not only
including bs->file and bs->backing_hd, but also driver-specific
ones like VMDK extents or Quorum children.

For bdrv_swap(), the list of children of the swapped BDS stays at that
BDS (because that's where the pointers stay as well). The list head
moves and pointers to it must be fixed up therefore.

The list of children in the parent of the swapped BDS is not affected by
the swap. The contents of the BDS objects is swapped, so the existing
pointer in the parent automatically points to the newly swapped in BDS.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
block.c
include/block/block_int.h