On 5/19/20 12:56 PM, Vladimir Sementsov-Ogievskiy wrote:
We have a few bdrv_*() functions that can either spawn a new coroutine and wait for it with BDRV_POLL_WHILE() or use a fastpath if they are alreeady running in a coroutine. All of them duplicate basically the
already
same code. Factor the common code into a new function bdrv_run_co(). Signed-off-by: Kevin Wolf <[email protected]> Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]> [Factor out bdrv_run_co_entry too] --- Hi! I'm a bit lost on rebasing "block/io: safer inc/dec in_flight sections" (is it needed or not?), so, I decided to send just this one patch: I suggest to go a bit further, and refactor that bdrv_run_co don't need additional *ret argument neither NOT_DONE logic.
Yes, and this approach was easier to review than v1.
block/io.c | 191 ++++++++++++++++++++--------------------------------- 1 file changed, 70 insertions(+), 121 deletions(-)
Reviewed-by: Eric Blake <[email protected]> -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
