[Qemu-devel] [PATCH v3 1/2] block: Use bdrv_unref_child() for all children in bdrv_close()

2019-05-13 Thread Alberto Garcia
bdrv_unref_child() does the following things: - Updates the child->bs->inherits_from pointer. - Calls bdrv_detach_child() to remove the BdrvChild from bs->children. - Calls bdrv_unref() to unref the child BlockDriverState. When bdrv_unref_child() was introduced in commit 33a604075c it was n

Re: [Qemu-devel] [PATCH v3 1/2] block: Use bdrv_unref_child() for all children in bdrv_close()

2019-05-23 Thread Alberto Garcia
On Mon 13 May 2019 03:46:17 PM CEST, Alberto Garcia wrote: > Now bdrv_close() unrefs all children (before this patch it was only > bs->file and bs->backing). As a result, none of the callers of > brvd_attach_child() should remove their reference to child_bs (because > this function effectively stea

Re: [Qemu-devel] [PATCH v3 1/2] block: Use bdrv_unref_child() for all children in bdrv_close()

2019-05-23 Thread Max Reitz
On 23.05.19 17:27, Alberto Garcia wrote: > On Mon 13 May 2019 03:46:17 PM CEST, Alberto Garcia wrote: >> Now bdrv_close() unrefs all children (before this patch it was only >> bs->file and bs->backing). As a result, none of the callers of >> brvd_attach_child() should remove their reference to chil