03.05.2021 18:51, Alberto Garcia wrote:
On Mon 03 May 2021 01:33:57 PM CEST, Vladimir Sementsov-Ogievskiy
wrote:
@@ -2918,12 +2918,18 @@ BdrvChild *bdrv_root_attach_child(BlockDriverState
*child_bs,
child_role, perm, shared_perm, opaque,
On Mon 03 May 2021 01:33:57 PM CEST, Vladimir Sementsov-Ogievskiy
wrote:
> @@ -2918,12 +2918,18 @@ BdrvChild *bdrv_root_attach_child(BlockDriverState
> *child_bs,
> child_role, perm, shared_perm, opaque,
> &child, tran, errp
bdrv_attach_child_common() doesn't require tran_finalize() on failure
(it does tran_add() only on success path). Still tran_new() must be
paired with tran_finalize() anyway, at least to free empty Transaction
object itself.
So, refactor the function for clean finalization code, same on all
paths.