[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
- [PATCH v2 00/10] mirror: cancel nbd reconnect, Vladimir Sementsov-Ogievskiy, 2021/02/05
- [PATCH v2 01/10] block: add new BlockDriver handler: bdrv_cancel_in_flight, Vladimir Sementsov-Ogievskiy, 2021/02/05
- [PATCH v2 02/10] block/nbd: implement .bdrv_cancel_in_flight, Vladimir Sementsov-Ogievskiy, 2021/02/05
- Re: [PATCH v2 02/10] block/nbd: implement .bdrv_cancel_in_flight,
Eric Blake <=
- [PATCH v2 10/10] iotests/264: add backup-cancel test-case, Vladimir Sementsov-Ogievskiy, 2021/02/05
- [PATCH v2 04/10] job: add .cancel handler for the driver, Vladimir Sementsov-Ogievskiy, 2021/02/05
- [PATCH v2 05/10] block/mirror: implement .cancel job handler, Vladimir Sementsov-Ogievskiy, 2021/02/05
- [PATCH v2 06/10] iotests/264: move to python unittest, Vladimir Sementsov-Ogievskiy, 2021/02/05
- [PATCH v2 03/10] block/raw-format: implement .bdrv_cancel_in_flight handler, Vladimir Sementsov-Ogievskiy, 2021/02/05
- [PATCH v2 08/10] iotests/264: add mirror-cancel test-case, Vladimir Sementsov-Ogievskiy, 2021/02/05
- [PATCH v2 07/10] iotests.py: qemu_nbd_popen: remove pid file after use, Vladimir Sementsov-Ogievskiy, 2021/02/05
- [PATCH v2 09/10] block/backup: implement .cancel job handler, Vladimir Sementsov-Ogievskiy, 2021/02/05
- Re: [PATCH v2 00/10] mirror: cancel nbd reconnect, Eric Blake, 2021/02/12