On 9/7/26 19:47, Niklas Cassel wrote:
>>> diff --git a/block/io.c b/block/io.c
>>> index b59c7fdf3e..452254bc63 100644
>>> --- a/block/io.c
>>> +++ b/block/io.c
>>> @@ -3378,6 +3378,15 @@ uint32_t bdrv_zone_index(BlockDriverState *bs,
>>> uint64_t offset)
>>> return offset >> ctz64(bs->bl.zone_size);
>>> }
>>>
>>> +bool bdrv_zone_is_full(BlockDriverState *bs, uint32_t index)
>>> +{
>>> + uint64_t zone_end = MIN((uint64_t)(index + 1) * bs->bl.zone_size,
>>
>> I think this should look at zone capacity, not size. For cases where we have
>> zone cap < zone size, zone full condition is reached when the write pointer
>> is
>> at the zone capacity.
>
> There is no concept of zone capacity in QEMU upstream yet.
>
> It is added in Sam Li's QCOW2 zoned patch series.
>
> But yes, I already have a patch that modifies bdrv_zone_is_full() to use
> zone capacity rather than zone size, once it is introduced.
OK. Thank you for the clarification.
--
Damien Le Moal
Western Digital Research