[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
- [PATCH 5/8] migration/block: replace uses of blk_nb_sectors that do not check result, (continued)
- [PATCH 5/8] migration/block: replace uses of blk_nb_sectors that do not check result, Paolo Bonzini, 2023/04/07
- [PATCH 4/8] block: remove has_variable_length from BlockDriver, Paolo Bonzini, 2023/04/07
- [PATCH 6/8] block-backend: inline bdrv_co_get_geometry, Paolo Bonzini, 2023/04/07
- [PATCH 8/8] block, block-backend: write some hot coroutine wrappers by hand, Paolo Bonzini, 2023/04/07
- [PATCH 7/8] block-backend: ignore inserted state in blk_co_nb_sectors, Paolo Bonzini, 2023/04/07
- Re: [PATCH 7/8] block-backend: ignore inserted state in blk_co_nb_sectors,
Eric Blake <=
- Re: [PATCH 8.0 regression 0/8] block: remove bdrv_co_get_geometry coroutines from I/O hot path, Kevin Wolf, 2023/04/11