qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 7/8] block-backend: ignore inserted state in blk_co_nb_sector


From: Eric Blake
Subject: Re: [PATCH 7/8] block-backend: ignore inserted state in blk_co_nb_sectors
Date: Fri, 7 Apr 2023 15:00:15 -0500
User-agent: NeoMutt/20230322

On Fri, Apr 07, 2023 at 05:33:02PM +0200, Paolo Bonzini wrote:
> All callers of blk_co_nb_sectors (and blk_nb_sectors) are able to
> handle a non-inserted CD-ROM as a zero-length file, they do not need
> to raise an error.
> 
> Not using blk_co_is_available() aligns the function with
> blk_co_get_geometry(), which becomes a simple wrapper for
> blk_co_nb_sectors().  It will also make it possible to skip the creation
> of a coroutine in the (common) case where bs->bl.has_variable_length
> is false.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  block/block-backend.c | 23 ++++++++---------------
>  1 file changed, 8 insertions(+), 15 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]