[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v5 11/42] block: Add bdrv_supports_compressed_wr
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH v5 11/42] block: Add bdrv_supports_compressed_writes() |
Date: |
Thu, 13 Jun 2019 16:19:39 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 |
On 13.06.19 15:29, Vladimir Sementsov-Ogievskiy wrote:
> 13.06.2019 1:09, Max Reitz wrote:
>> Filters cannot compress data themselves but they have to implement
>> .bdrv_co_pwritev_compressed() still (or they cannot forward compressed
>> writes). Therefore, checking whether
>> bs->drv->bdrv_co_pwritev_compressed is non-NULL is not sufficient to
>> know whether the node can actually handle compressed writes. This
>> function looks down the filter chain to see whether there is a
>> non-filter that can actually convert the compressed writes into
>> compressed data (and thus normal writes).
>
> Why not to use this function in (as I remember only 2-3 cases) when
> we check for bs->drv->bdrv_co_pwritev_compressed? It would be a complete fix
> for described problem.
Well, bdrv_driver_pwritev_compressed() doesn’t really care, it will find
out sooner or later anyway (while being passed down the chain). This is
only really important for the backup job, which will use this function
as of patch 26. (It isn’t important before 26, because using filters
with backup generally is a gamble before that patch.)
> (hmm, ok, other new APIs are added separately too, for some reason they don't
> confuse me and this confuses)
>
> On the other hand, (the second time I think about it during review), could
> we handle compression through flags completely?
> We have supported_write_flags feature, which should be used for all these
> checks..
> And may be, we may drop .bdrv_co_pwritev_compressed at all.
We probably could, yes. I just felt like this wasn’t the time to do it.
O:-)
> But if you want to keep it as is, it's OK too:
> Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Thanks for reviewing!
Max
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-block] [PATCH v5 06/42] qcow2: Implement .bdrv_storage_child(), (continued)
- [Qemu-block] [PATCH v5 08/42] block: bdrv_set_backing_hd() is about bs->backing, Max Reitz, 2019/06/12
- [Qemu-block] [PATCH v5 07/42] block: *filtered_cow_child() for *has_zero_init(), Max Reitz, 2019/06/12
- [Qemu-block] [PATCH v5 10/42] block: Use CAF in bdrv_is_encrypted(), Max Reitz, 2019/06/12
- [Qemu-block] [PATCH v5 11/42] block: Add bdrv_supports_compressed_writes(), Max Reitz, 2019/06/12
- [Qemu-block] [PATCH v5 09/42] block: Include filters when freezing backing chain, Max Reitz, 2019/06/12
- [Qemu-block] [PATCH v5 12/42] block: Use bdrv_filtered_rw* where obvious, Max Reitz, 2019/06/12
- [Qemu-block] [PATCH v5 13/42] block: Use CAFs in block status functions, Max Reitz, 2019/06/12
- [Qemu-block] [PATCH v5 14/42] block: Use CAFs when working with backing chains, Max Reitz, 2019/06/12