On Fri, Oct 30, 2026 at 02:06:11AM +0100, Denis V. Lunev wrote:
> From: Denis V. Lunev <[email protected]>
> 
> Getting or putting nothing cannot change the pool, yet both calls take
> the mutex, and co_put_to_shres() also wakes every waiter to find the
> pool unchanged. Return early when n is zero.
> 
> block-copy is about to reserve nothing for write-zeroes tasks the target
> serves without a buffer, which makes such calls the common case for a
> mostly-zero image.
> 
> Suggested-by: Vladimir Sementsov-Ogievskiy <[email protected]>
> Signed-off-by: Denis V. Lunev <[email protected]>
> CC: Vladimir Sementsov-Ogievskiy <[email protected]>
> CC: John Snow <[email protected]>
> CC: Andrey Drobyshev <[email protected]>
> ---
>  util/qemu-co-shared-resource.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

Reviewed-by: Eric Blake <[email protected]>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org


Reply via email to