[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 14/24] nbd: Switch from close to eject notifi
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v7 14/24] nbd: Switch from close to eject notifier |
Date: |
Mon, 30 Nov 2015 16:36:21 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 09.11.2015 um 23:39 hat Max Reitz geschrieben:
> The NBD code uses the BDS close notifier to determine when a medium is
> ejected. However, now it should use the BB's BDS removal notifier for
> that instead of the BDS's close notifier.
>
> Signed-off-by: Max Reitz <address@hidden>
> ---
> blockdev-nbd.c | 37 +------------------------------------
> nbd.c | 13 +++++++++++++
> 2 files changed, 14 insertions(+), 36 deletions(-)
>
> diff --git a/blockdev-nbd.c b/blockdev-nbd.c
> index bcdd18b..b28a55b 100644
> --- a/blockdev-nbd.c
> +++ b/blockdev-nbd.c
> @@ -46,37 +46,11 @@ void qmp_nbd_server_start(SocketAddress *addr, Error
> **errp)
> }
> }
>
> -/*
> - * Hook into the BlockBackend notifiers to close the export when the
> - * backend is closed.
> - */
> -typedef struct NBDCloseNotifier {
> - Notifier n;
> - NBDExport *exp;
> - QTAILQ_ENTRY(NBDCloseNotifier) next;
> -} NBDCloseNotifier;
> -
> -static QTAILQ_HEAD(, NBDCloseNotifier) close_notifiers =
> - QTAILQ_HEAD_INITIALIZER(close_notifiers);
> -
> -static void nbd_close_notifier(Notifier *n, void *data)
> -{
> - NBDCloseNotifier *cn = DO_UPCAST(NBDCloseNotifier, n, n);
> -
> - notifier_remove(&cn->n);
> - QTAILQ_REMOVE(&close_notifiers, cn, next);
> -
> - nbd_export_close(cn->exp);
> - nbd_export_put(cn->exp);
Here you remove a close/put pair, but in the new code you only add the
close call. Why is this correct?
Kevin
- Re: [Qemu-devel] [PATCH v7 12/24] virtio-blk: Functions for op blocker management, (continued)
- Re: [Qemu-devel] [PATCH v7 12/24] virtio-blk: Functions for op blocker management, Kevin Wolf, 2015/11/25
- Re: [Qemu-devel] [PATCH v7 12/24] virtio-blk: Functions for op blocker management, Max Reitz, 2015/11/25
- Re: [Qemu-devel] [PATCH v7 12/24] virtio-blk: Functions for op blocker management, Kevin Wolf, 2015/11/25
- Re: [Qemu-devel] [PATCH v7 12/24] virtio-blk: Functions for op blocker management, Max Reitz, 2015/11/25
- Re: [Qemu-devel] [PATCH v7 12/24] virtio-blk: Functions for op blocker management, Stefan Hajnoczi, 2015/11/26
- Re: [Qemu-devel] [PATCH v7 12/24] virtio-blk: Functions for op blocker management, Kevin Wolf, 2015/11/26
- [Qemu-devel] [PATCH v7 13/24] virtio-scsi: Catch BDS-BB removal/insertion, Max Reitz, 2015/11/09
- [Qemu-devel] [PATCH v7 14/24] nbd: Switch from close to eject notifier, Max Reitz, 2015/11/09
- Re: [Qemu-devel] [PATCH v7 14/24] nbd: Switch from close to eject notifier,
Kevin Wolf <=
- [Qemu-devel] [PATCH v7 15/24] block: Remove BDS close notifier, Max Reitz, 2015/11/09
- [Qemu-devel] [PATCH v7 16/24] block: Use blk_remove_bs() in blk_delete(), Max Reitz, 2015/11/09
- [Qemu-devel] [PATCH v7 17/24] blockdev: Use blk_remove_bs() in do_drive_del(), Max Reitz, 2015/11/09
- [Qemu-devel] [PATCH v7 18/24] block: Make bdrv_close() static, Max Reitz, 2015/11/09
- [Qemu-devel] [PATCH v7 19/24] block: Add list of all BlockDriverStates, Max Reitz, 2015/11/09