[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v2 04/25] include/block/block: split header into I/O and
From: |
Eric Blake |
Subject: |
Re: [RFC PATCH v2 04/25] include/block/block: split header into I/O and global state API |
Date: |
Thu, 7 Oct 2021 08:18:29 -0500 |
User-agent: |
NeoMutt/20210205-818-e2615c |
On Thu, Oct 07, 2021 at 01:51:33PM +0200, Paolo Bonzini wrote:
> On 07/10/21 12:54, Emanuele Giuseppe Esposito wrote:
> > >
> > > > +int bdrv_block_status(BlockDriverState *bs, int64_t offset,
> > > > + int64_t bytes, int64_t *pnum, int64_t *map,
> > > > + BlockDriverState **file);
> > >
> > > This function just called bdrv_block_status_above(), which is in the I/O
> > > API. I think it's safe to move this to the I/O API or else
> > > bdrv_block_status_above() shouldn't be there :).
> > >
> >
> > It *seems* that while bdrv_block_status_above() is an I/O, probably
> > running in some coroutine (from here its internal qemu_in_coroutine
> > check), bdrv_block_status might be called from the main loop (or
> > alternatively the function is never invoked in the tests, so the
> > assertion never triggered).
> >
> > Maybe bdrv_block_status_above is one of the few functions that are both
> > I/O and Main loop? I put it in I/O as it can't have the assertion.
>
> No, they are both I/O. Callers of bdrv_block_status are hw/nvme and
> qemu-img.c; while the latter can be either (it does not have iothreads),
> hw/nvme is definitely I/O.
nbd/server.c also uses bdrv_block_status_above as part of its I/O path
to serve NBD_CMD_BLOCK_STATUS.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[RFC PATCH v2 08/25] block: introduce assert_bdrv_graph_writable, Emanuele Giuseppe Esposito, 2021/10/05
[RFC PATCH v2 10/25] assertions for blockjob_int.h, Emanuele Giuseppe Esposito, 2021/10/05