[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 07/29] block/export: Remove magic from block-export-add
From: |
Max Reitz |
Subject: |
Re: [PATCH 07/29] block/export: Remove magic from block-export-add |
Date: |
Thu, 10 Sep 2020 12:53:43 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
On 07.09.20 20:19, Kevin Wolf wrote:
> nbd-server-add tries to be convenient and adds two questionable
> features that we don't want to share in block-export-add, even for NBD
> exports:
>
> 1. When requesting a writable export of a read-only device, the export
> is silently downgraded to read-only. This should be an error in the
> context of block-export-add.
>
> 2. When using a BlockBackend name, unplugging the device from the guest
> will automatically stop the NBD server, too. This may sometimes be
> what you want, but it could also be very surprising. Let's keep
> things explicit with block-export-add. If the user wants to stop the
> export, they should tell us so.
>
> Move these things into the nbd-server-add QMP command handler so that
> they apply only there.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> include/block/export.h | 2 ++
> include/block/nbd.h | 3 ++-
> block/export/export.c | 13 +++++++++---
> blockdev-nbd.c | 47 +++++++++++++++++++++++++++++++++++-------
> nbd/server.c | 20 +++++++++++-------
> qemu-nbd.c | 3 +--
> 6 files changed, 67 insertions(+), 21 deletions(-)
[...]
> + if (bdrv_is_read_only(bs)) {
> + export_opts.u.nbd.has_writable = true;
Ah, yes, setting that might be nice. :)
Reviewed-by: Max Reitz <mreitz@redhat.com>
signature.asc
Description: OpenPGP digital signature
- [PATCH 00/29] block/export: Add infrastructure and QAPI for block exports, Kevin Wolf, 2020/09/07
- [PATCH 01/29] nbd: Remove unused nbd_export_get_blockdev(), Kevin Wolf, 2020/09/07
- [PATCH 03/29] qapi: Rename BlockExport to BlockExportOptions, Kevin Wolf, 2020/09/07
- [PATCH 05/29] qemu-storage-daemon: Use qmp_block_export_add(), Kevin Wolf, 2020/09/07
- [PATCH 02/29] qapi: Create block-export module, Kevin Wolf, 2020/09/07
- [PATCH 08/29] nbd: Add max-connections to nbd-server-start, Kevin Wolf, 2020/09/07
- [PATCH 04/29] block/export: Add BlockExport infrastructure and block-export-add, Kevin Wolf, 2020/09/07
- [PATCH 06/29] qemu-nbd: Use raw block driver for --offset, Kevin Wolf, 2020/09/07
- [PATCH 07/29] block/export: Remove magic from block-export-add, Kevin Wolf, 2020/09/07
- Re: [PATCH 07/29] block/export: Remove magic from block-export-add,
Max Reitz <=
- [PATCH 09/29] nbd: Add writethrough to block-export-add, Kevin Wolf, 2020/09/07
- [PATCH 10/29] nbd: Remove NBDExport.close callback, Kevin Wolf, 2020/09/07
- [PATCH 11/29] qemu-nbd: Use blk_exp_add() to create the export, Kevin Wolf, 2020/09/07
- [PATCH 12/29] nbd/server: Simplify export shutdown, Kevin Wolf, 2020/09/07
- [PATCH 13/29] block/export: Move refcount from NBDExport to BlockExport, Kevin Wolf, 2020/09/07
- [PATCH 14/29] block/export: Move AioContext from NBDExport to BlockExport, Kevin Wolf, 2020/09/07
- [PATCH 16/29] block/export: Allocate BlockExport in blk_exp_add(), Kevin Wolf, 2020/09/07