[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 07/54] block: Use BlockBackend for image probing
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH 07/54] block: Use BlockBackend for image probing |
Date: |
Wed, 22 Feb 2017 13:56:47 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
On 21.02.2017 15:58, Kevin Wolf wrote:
> This fixes the use of a parent-less BdrvChild in bdrv_open_inherit() by
> converting it into a BlockBackend. Which is exactly what it should be,
> image probing is an external, standalone user of a node. The requests
> can't be considered to originate from the format driver node because
> that one isn't even opened yet.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> block.c | 34 +++++++++++++++++++---------------
> 1 file changed, 19 insertions(+), 15 deletions(-)
>
> diff --git a/block.c b/block.c
> index e9d90aa..0f17576 100644
> --- a/block.c
> +++ b/block.c
[...]
> @@ -1922,7 +1926,7 @@ static BlockDriverState *bdrv_open_inherit(const char
> *filename,
>
> fail:
> if (file != NULL) {
> - bdrv_unref_child(bs, file);
> + blk_unref(file);
> }
You could drop the now superfluous condition around it, but anyway:
Reviewed-by: Max Reitz <address@hidden>
(Also, you could revert the change to bdrv_unref_child() done in patch 5.)
Max
> if (bs->file != NULL) {
> bdrv_unref_child(bs, bs->file);
>
signature.asc
Description: OpenPGP digital signature
- [Qemu-block] [PATCH 03/54] mirror: Resize active commit base in mirror_run(), (continued)
- [Qemu-block] [PATCH 03/54] mirror: Resize active commit base in mirror_run(), Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 04/54] block: Pass BdrvChild to bdrv_truncate(), Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 06/54] block: Factor out bdrv_open_child_bs(), Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 05/54] block: Attach bs->file only during .bdrv_open(), Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 07/54] block: Use BlockBackend for image probing, Kevin Wolf, 2017/02/21
- Re: [Qemu-block] [PATCH 07/54] block: Use BlockBackend for image probing,
Max Reitz <=
- [Qemu-block] [PATCH 01/54] blockdev: Use BlockBackend to resize in qmp_block_resize(), Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 08/54] block: Factor out bdrv_open_driver(), Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 09/54] block: Add bdrv_new_open_driver(), Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 10/54] vvfat: Use opened node as backing file, Kevin Wolf, 2017/02/21