[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v7 1/9] mirror: inherit supported write/zero fla
Re: [Qemu-block] [PATCH v7 1/9] mirror: inherit supported write/zero flags
Wed, 31 Jan 2018 18:20:18 +0100
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2
On 2018-01-30 13:15, Anton Nefedov wrote:
> On 29/1/2018 10:26 PM, Eric Blake wrote:
>> On 01/29/2018 01:21 PM, Max Reitz wrote:
>>> On 2018-01-18 18:48, Anton Nefedov wrote:
>>>> Signed-off-by: Anton Nefedov <address@hidden>
>>>> Reviewed-by: Eric Blake <address@hidden>
>>>> Reviewed-by: Alberto Garcia <address@hidden>
>>>> block/mirror.c | 5 +++++
>>>> 1 file changed, 5 insertions(+)
>>>> diff --git a/block/mirror.c b/block/mirror.c
>>>> index c9badc1..d18ec65 100644
>>>> --- a/block/mirror.c
>>>> +++ b/block/mirror.c
>>>> @@ -1064,6 +1064,11 @@ static void
>>>> bdrv_mirror_top_refresh_filename(BlockDriverState *bs, QDict *opts)
>>>> pstrcpy(bs->exact_filename, sizeof(bs->exact_filename),
>>>> + bs->supported_write_flags = BDRV_REQ_FUA &
>>>> + bs->backing->bs->supported_write_flags;
>>>> + bs->supported_zero_flags =
>>>> + (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) &
>>>> + bs->backing->bs->supported_zero_flags;
>>>> static void bdrv_mirror_top_close(BlockDriverState *bs)
>>> Fundamentally OK, but why is this in *_refresh_filename()?
>> Indeed, I missed that (or maybe it got moved during a botched rebase?).
>> For comparison, blkdebug sets it during blkdebug_open(), and nbd sets it
>> during nbd_client_init() (called during nbd_open()).
> We need a backing bs here and I believe it's not generally set at the
> time of .bdrv_open().
Well, but *_refresh_filename() is just wrong.
This driver doesn't have .bdrv_open() at all, and we create it fully
manually in mirror_start_job() anyway (as Eric has said). Therefore, we
can just do this right after bdrv_append() there has succeeded.
Description: OpenPGP digital signature
[Qemu-block] [PATCH v7 5/9] file-posix: support BDRV_REQ_ALLOCATE, Anton Nefedov, 2018/01/18
[Qemu-block] [PATCH v7 7/9] qcow2: move is_zero() up, Anton Nefedov, 2018/01/18
[Qemu-block] [PATCH v7 3/9] block: introduce BDRV_REQ_ALLOCATE flag, Anton Nefedov, 2018/01/18
[Qemu-block] [PATCH v7 9/9] iotest 134: test cluster-misaligned encrypted write, Anton Nefedov, 2018/01/18