On Mon, 07/03 17:14, Eric Blake wrote: > @@ -1717,6 +1718,10 @@ int64_t coroutine_fn > bdrv_co_get_block_status_from_backing(BlockDriverState *bs, > * Drivers not implementing the functionality are assumed to not support > * backing files, hence all their sectors are reported as allocated. > * > + * If 'allocation' is true, the caller only cares about allocation > + * status; this is a hint that a larger 'pnum' result is more > + * important than including BDRV_BLOCK_OFFSET_VALID in the return. > + *
This is slightly unintuitive. I would guess "allocation == false" means "I don't care about the allocation status" but it actually is "I don't care about the consecutiveness". The "only" semantics is missing in the parameter name. Maybe rename it to "consecutive" and invert the logic? I.e. "consecutive == true" means BDRV_BLOCK_OFFSET_VALID is wanted. Sorry for bikeshedding. Fam