block: Unify bdrv_child_cb_attach()
commitca2f1234c3c051f416fb0a1d09eecde328a6dd51
authorMax Reitz <mreitz@redhat.com>
Wed, 13 May 2020 11:05:22 +0000 (13 13:05 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 18 May 2020 17:05:25 +0000 (18 19:05 +0200)
treee569dec7e562c16bac88c6d7c9730c2367fc27db
parent00ff7ffd67c50fe45a1e313765d416d082541128
block: Unify bdrv_child_cb_attach()

Make bdrv_child_cb_attach() call bdrv_backing_attach() for children with
a COW role (and drop the reverse call from bdrv_backing_attach()), so it
can be used for any child (with a proper role set).

Because so far no child has a proper role set, we need a temporary new
callback for child_backing.attach that ensures bdrv_backing_attach() is
called for all COW children that do not have their role set yet.

(Also, move bdrv_child_cb_attach() down to group it with
bdrv_inherited_options().)

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200513110544.176672-13-mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c