block: Reorder cleanups in bdrv_close()
authorKevin Wolf <kwolf@redhat.com>
Tue, 16 Jun 2015 08:58:20 +0000 (10:58 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 14 Jul 2015 15:15:23 +0000 (17:15 +0200)
commit9a7dedbc43c7c400663d2876a8ccb6d942a1429a
tree5bddec89d59df8211f438fa49ef2256bd617d423
parent33a604075c51e5528eed970eeaeefe609ea2337d
block: Reorder cleanups in bdrv_close()

Block drivers may still want to access their child nodes in their
.bdrv_close handler. If they unref and/or detach a child by themselves,
this should not result in a double free.

There is additional code for backing files, which are just a special
case of child nodes. The same applies for them.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
block.c