[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 21/31] block/export: Add BLOCK_EXPORT_DELETED event
From: |
Max Reitz |
Subject: |
Re: [PATCH v2 21/31] block/export: Add BLOCK_EXPORT_DELETED event |
Date: |
Fri, 25 Sep 2020 14:34:39 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
On 24.09.20 17:27, Kevin Wolf wrote:
> Clients may want to know when an export has finally disappeard
> (block-export-del returns earlier than that in the general case), so add
> a QAPI event for it.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> qapi/block-export.json | 12 ++++++++++++
> block/export/export.c | 2 ++
> tests/qemu-iotests/140 | 9 ++++++++-
> tests/qemu-iotests/140.out | 2 +-
> tests/qemu-iotests/223.out | 4 ++++
> 5 files changed, 27 insertions(+), 2 deletions(-)
[...]
> diff --git a/tests/qemu-iotests/140 b/tests/qemu-iotests/140
> index 8d2ce5d9e3..309b177e77 100755
> --- a/tests/qemu-iotests/140
> +++ b/tests/qemu-iotests/140
> @@ -81,10 +81,17 @@ $QEMU_IO_PROG -f raw -r -c 'read -P 42 0 64k' \
> "nbd+unix:///drv?socket=$SOCK_DIR/nbd" 2>&1 \
> | _filter_qemu_io | _filter_nbd
>
> +# The order of 'return' and the BLOCK_EXPORT_DELETED event is undefined. Just
> +# wait until we've twice seen one of them. Filter the 'return' line out so
> that
> +# the output is defined.
> _send_qemu_cmd $QEMU_HANDLE \
> "{ 'execute': 'eject',
> 'arguments': { 'device': 'drv' }}" \
> - 'return'
> + 'return\|BLOCK_EXPORT_DELETED' |
> + grep -v 'return'
> +
> +_send_qemu_cmd $QEMU_HANDLE '' 'return\|BLOCK_EXPORT_DELETED' |
> + grep -v 'return'
Funny. I did basically the same thing (only I filtered the event, not
the return):
https://git.xanclic.moe/XanClic/qemu/commit/e6f7510149a4a26c868013639ec89d28f16857d8#diff-3
and considered it kind of a hack.
Oh well. :)
Reviewed-by: Max Reitz <mreitz@redhat.com>
> $QEMU_IO_PROG -f raw -r -c close \
> "nbd+unix:///drv?socket=$SOCK_DIR/nbd" 2>&1 \
signature.asc
Description: OpenPGP digital signature
- [PATCH v2 14/31] block/export: Move AioContext from NBDExport to BlockExport, (continued)
- [PATCH v2 14/31] block/export: Move AioContext from NBDExport to BlockExport, Kevin Wolf, 2020/09/24
- [PATCH v2 16/31] block/export: Allocate BlockExport in blk_exp_add(), Kevin Wolf, 2020/09/24
- [PATCH v2 13/31] block/export: Move refcount from NBDExport to BlockExport, Kevin Wolf, 2020/09/24
- [PATCH v2 15/31] block/export: Add node-name to BlockExportOptions, Kevin Wolf, 2020/09/24
- [PATCH v2 19/31] block/export: Move strong user reference to block_exports, Kevin Wolf, 2020/09/24
- [PATCH v2 20/31] block/export: Add block-export-del, Kevin Wolf, 2020/09/24
- [PATCH v2 17/31] block/export: Add blk_exp_close_all(_type), Kevin Wolf, 2020/09/24
- [PATCH v2 22/31] block/export: Move blk to BlockExport, Kevin Wolf, 2020/09/24
- [PATCH v2 18/31] block/export: Add 'id' option to block-export-add, Kevin Wolf, 2020/09/24
- [PATCH v2 21/31] block/export: Add BLOCK_EXPORT_DELETED event, Kevin Wolf, 2020/09/24
- Re: [PATCH v2 21/31] block/export: Add BLOCK_EXPORT_DELETED event,
Max Reitz <=
- [PATCH v2 24/31] block/export: Add query-block-exports, Kevin Wolf, 2020/09/24
- [PATCH v2 25/31] block/export: Move writable to BlockExportOptions, Kevin Wolf, 2020/09/24
- [PATCH v2 26/31] nbd: Merge nbd_export_new() and nbd_export_create(), Kevin Wolf, 2020/09/24
- [PATCH v2 30/31] iotests: Allow supported and unsupported formats at the same time, Kevin Wolf, 2020/09/24
- [PATCH v2 28/31] iotests: Factor out qemu_tool_pipe_and_status(), Kevin Wolf, 2020/09/24
- [PATCH v2 23/31] block/export: Create BlockBackend in blk_exp_add(), Kevin Wolf, 2020/09/24
- [PATCH v2 31/31] iotests: Test block-export-* QMP interface, Kevin Wolf, 2020/09/24