qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 02/10] block/nbd: implement .bdrv_cancel_in_flight


From: Eric Blake
Subject: Re: [PATCH v2 02/10] block/nbd: implement .bdrv_cancel_in_flight
Date: Fri, 12 Feb 2021 11:14:24 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

On 2/5/21 10:37 AM, Vladimir Sementsov-Ogievskiy wrote:
> Just stop waiting for connection in existing requests.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> ---
>  block/nbd.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/block/nbd.c b/block/nbd.c
> index b3cbbeb4b0..c26dc5a54f 100644
> --- a/block/nbd.c
> +++ b/block/nbd.c
> @@ -2458,6 +2458,18 @@ static const char *const nbd_strong_runtime_opts[] = {
>      NULL
>  };
>  
> +static void nbd_cancel_in_flight(BlockDriverState *bs)
> +{
> +    BDRVNBDState *s = (BDRVNBDState *)bs->opaque;

This cast is not necessary in C, but it doesn't hurt.

> +
> +    reconnect_delay_timer_del(s);
> +
> +    if (s->state == NBD_CLIENT_CONNECTING_WAIT) {
> +        s->state = NBD_CLIENT_CONNECTING_NOWAIT;
> +        qemu_co_queue_restart_all(&s->free_sema);
> +    }
> +}
> +

R-b still stands

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]