> Check exit conditions before entering blocking aio_poll().  This is
> mainly for consistency since it's unlikely that we are stopping in the
> first event loop iteration.
> 
> Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com>
> ---
>   hw/block/dataplane/virtio-blk.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c
> index 2faed43..8d3e145 100644
> --- a/hw/block/dataplane/virtio-blk.c
> +++ b/hw/block/dataplane/virtio-blk.c
> @@ -379,9 +379,9 @@ static void *data_plane_thread(void *opaque)
>   {
>       VirtIOBlockDataPlane *s = opaque;
> 
> -    do {
> +    while (!s->stopping || s->num_reqs > 0) {
>           aio_poll(s->ctx, true);
> -    } while (!s->stopping || s->num_reqs > 0);
> +    }
>       return NULL;
>   }
>
It seems more likely a bug fix.

Reviewed-by: Wenchao Xia <xiaw...@linux.vnet.ibm.com>

-- 
Best Regards

Wenchao Xia


Reply via email to