Am 08/03/2022 um 14:41 schrieb Stefan Hajnoczi:
> It's not clear to me that .get_parent_aio_context() should only be
> called from the main thread. The API is read-only so someone might try
> to call from I/O code in the future expecting it to work like other
> read-only graph APIs that are available from I/O code.
> 
> Currently the assertion is true because the only user is
> bdrv_attach_child_*() but please document this invariant for
> bdrv_child_get_parent_aio_context() and the callback. Maybe move the
> assertion into a higher-level function like
> bdrv_child_get_parent_aio_context() (if that still covers all cases).

We classified .get_parent_aio_context as GS callback, and indeed
bdrv_child_get_parent_aio_context has the macro GLOBAL_STATE_CODE();
So we should be fine.

Emanuele


Reply via email to