On 9/14/26 5:52 PM, Denis V. Lunev wrote: > From: Denis V. Lunev <[email protected]> > > block_copy_reset_unallocated()'s up-front scan already queries the > source, and the same query reports zero-ness. The copy loop re-queries > per task and, having no answer up front, can only size a task by the > copy buffer, so a mostly-zero image is cut into thousands of pieces > that each turn out to read as zero. > > Cache the answer in zero_bitmap, published by zero_bitmap_valid once > the scan is done. block_copy_task_create() then picks the method from > the bitmap and ends the task where the answer changes, so a zero task > never reaches into data and a copy task never swallows a zero run. The > per-task query stays as the fallback until the flag is set, since CBW > intercepts guest writes while the scan is still running. > > [...]
Reviewed-by: Andrey Drobyshev <[email protected]> -- Andrey Drobyshev <[email protected]>
