[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 05/54] block: Attach bs->file only during .bdrv_
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH 05/54] block: Attach bs->file only during .bdrv_open() |
Date: |
Wed, 22 Feb 2017 13:41:42 +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:
> The way that attaching bs->file worked was a bit unusual in that it was
> the only child that would be attached to a node which is not opened yet.
> Because of this, the block layer couldn't know yet which permissions the
> driver would eventually need.
>
> This patch moves the point where bs->file is attached to the beginning
> of the individual .bdrv_open() implementations, so drivers already know
> what they are going to do with the child. This is also more consistent
> with how driver-specific children work.
>
> For a moment, bdrv_open() gets its own BdrvChild to perform image
> probing, but instead of directly assigning this BdrvChild to the BDS, it
> becomes a temporary one and the node name is passed as an option to the
> drivers, so that they can simply use bdrv_open_child() to create another
> reference for their own use.
>
> This duplicated child for (the not opened yet) bs is not the final
> state, a follow-up patch will change the image probing code to use a
> BlockBackend, which is completely independent of bs.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> block.c | 35 ++++++++++++++++++++++++-----------
> block/bochs.c | 6 ++++++
> block/cloop.c | 6 ++++++
> block/crypto.c | 6 ++++++
> block/dmg.c | 6 ++++++
> block/parallels.c | 6 ++++++
> block/qcow.c | 6 ++++++
> block/qcow2.c | 18 +++++++++++++++---
> block/qed.c | 18 +++++++++++++++---
> block/raw-format.c | 6 ++++++
> block/replication.c | 6 ++++++
> block/vdi.c | 6 ++++++
> block/vhdx.c | 6 ++++++
> block/vmdk.c | 6 ++++++
> block/vpc.c | 6 ++++++
> tests/qemu-iotests/051.out | 4 ++--
> tests/qemu-iotests/051.pc.out | 4 ++--
> 17 files changed, 130 insertions(+), 21 deletions(-)
Reviewed-by: Max Reitz <address@hidden>
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-block] [PATCH 02/54] qcow2: Use BB for resizing in qcow2_amend_options(), (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
- Re: [Qemu-block] [PATCH 05/54] block: Attach bs->file only during .bdrv_open(),
Max Reitz <=
- [Qemu-block] [PATCH 07/54] block: Use BlockBackend for image probing, Kevin Wolf, 2017/02/21
- [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