Skip to content

block/export: Add infrastructure and QAPI for block exports

Kevin Wolf qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest31 patches 11 repliesIn review
  2. v129 patches 23 repliesSuperseded

Changes in v2 from the cover letter

- Rebased on current master
- Fixed assumption of &blk_exp_nbd instead of drv in generic code [Max]
- Documented blk_exp_request_shutdown() better [Max]
- iotests 140: Fixed race between QMP return value and event [Max]
- Improved the commit message for patch 26
- Removed copy&paste error in deprecated.rst [Max]
- iotests: Take Sequence instead of positional arguments in qemu_tool_pipe_and_status() [Max]
- iotests: Separate patch for qemu_nbd_list_log [Max]
- iotests 307: [Max]
* Allow more image formats
* Use sock_dir for the socket
* Use f-strings instead of % operator
* Log events after deleting an export
* Test force removing an export

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/31nbd: Remove unused nbd_export_get_blockdev()include/block/nbd.h nbd/server.c+0 -70 replies
2/31qapi: Create block-export moduleblock/monitor/block-hmp-cmds.c blockdev-nbd.c include/block/nbd.h +6 more+184 -1700 replies
3/31qapi: Rename BlockExport to BlockExportOptionsblock/monitor/block-hmp-cmds.c blockdev-nbd.c qapi/block-export.json +1 more+14 -140 replies
4/31block/export: Add BlockExport infrastructure and block-export-addblock/export/export.c block/export/meson.build block/meson.build +6 more+133 -101 reply
5/31qemu-storage-daemon: Use qmp_block_export_add()storage-daemon/qemu-storage-daemon.c+1 -120 replies
6/31qemu-nbd: Use raw block driver for --offsetblockdev-nbd.c include/block/nbd.h nbd/server.c +1 more+31 -420 replies
7/31block/export: Remove magic from block-export-addblock/export/export.c blockdev-nbd.c include/block/export.h +3 more+67 -210 replies
8/31nbd: Add max-connections to nbd-server-startblock/monitor/block-hmp-cmds.c blockdev-nbd.c include/block/nbd.h +2 more+39 -130 replies
9/31nbd: Add writethrough to block-export-addblockdev-nbd.c qapi/block-export.json+11 -20 replies
10/31nbd: Remove NBDExport.close callbackblockdev-nbd.c include/block/nbd.h nbd/server.c +1 more+7 -210 replies
11/31qemu-nbd: Use blk_exp_add() to create the exportblockdev-nbd.c include/block/nbd.h qemu-nbd.c+30 -70 replies
12/31nbd/server: Simplify export shutdownnbd/server.c+4 -130 replies
13/31block/export: Move refcount from NBDExport to BlockExportblock/export/export.c blockdev-nbd.c include/block/export.h +2 more+63 -420 replies
14/31block/export: Move AioContext from NBDExport to BlockExportblock/export/export.c include/block/export.h nbd/server.c+18 -130 replies
15/31block/export: Add node-name to BlockExportOptionsblock/monitor/block-hmp-cmds.c blockdev-nbd.c qapi/block-export.json +1 more+58 -210 replies
16/31block/export: Allocate BlockExport in blk_exp_add()block/export/export.c blockdev-nbd.c include/block/export.h +2 more+57 -360 replies
17/31block/export: Add blk_exp_close_all(_type)block.c block/export/export.c blockdev-nbd.c +4 more+107 -360 replies
18/31block/export: Add 'id' option to block-export-addblock/export/export.c blockdev-nbd.c include/block/export.h +4 more+39 -30 replies
19/31block/export: Move strong user reference to block_exportsblock/export/export.c blockdev-nbd.c include/block/export.h +1 more+14 -70 replies
20/31block/export: Add block-export-delblock/export/export.c block/monitor/block-hmp-cmds.c blockdev-nbd.c +4 more+77 -430 replies
21/31block/export: Add BLOCK_EXPORT_DELETED eventblock/export/export.c qapi/block-export.json tests/qemu-iotests/140 +2 more+27 -21 reply
22/31block/export: Move blk to BlockExportblock/export/export.c include/block/export.h nbd/server.c+28 -210 replies
23/31block/export: Create BlockBackend in blk_exp_add()block/export/export.c blockdev-nbd.c include/block/nbd.h +1 more+63 -610 replies
24/31block/export: Add query-block-exportsblock/export/export.c qapi/block-export.json+55 -00 replies
25/31block/export: Move writable to BlockExportOptionsblock/export/export.c blockdev-nbd.c nbd/server.c +2 more+32 -260 replies
26/31nbd: Merge nbd_export_new() and nbd_export_create()blockdev-nbd.c include/block/nbd.h nbd/server.c+45 -561 reply
27/31nbd: Deprecate nbd-server-add/removedocs/system/deprecated.rst qapi/block-export.json+15 -21 reply
28/31iotests: Factor out qemu_tool_pipe_and_status()tests/qemu-iotests/iotests.py+23 -261 reply
29/31iotests: Introduce qemu_nbd_list_log()tests/qemu-iotests/iotests.py+12 -11 reply
30/31iotests: Allow supported and unsupported formats at the same timetests/qemu-iotests/iotests.py+1 -51 reply
31/31iotests: Test block-export-* QMP interfacetests/qemu-iotests/307 tests/qemu-iotests/307.out tests/qemu-iotests/group+257 -01 reply

Reviews trailers per patch

All 31 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMax ReitzEric BlakeStefan Hajnoczi
SeriesA-b
1/31R-b R-b
2/31R-b R-b
3/31R-b R-b
4/31R-b R-b
5/31R-b R-b
6/31R-b R-b
7/31R-b
8/31R-b R-b
9/31R-b
10/31R-b R-b
11/31R-b
12/31R-b R-b
13/31R-b
14/31R-b
15/31R-b
16/31R-b
17/31R-b
18/31R-b
19/31R-b
20/31R-b
21/31R-b
22/31R-b
23/31R-b
24/31R-b
25/31R-b
26/31R-b
27/31R-b
28/31R-b
29/31R-b
30/31R-b
31/31R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/31] block/export: Add infrastructure and QAPI for block exports

We are planning to add more block export types than just NBD in the near future (e.g. vhost-user-blk and FUSE). This series lays the ground for this with some generic block export infrastructure and QAPI interfaces that will allow managing all of them (for now add/remove/query).

As a side effect, qemu-storage-daemon can now map --export directly to the block-export-add QMP command, similar to other command line options. The built-in NBD servers also gains new options that bring it at least a little closer to feature parity with qemu-nbd.

v2:
- Rebased on current master
- Fixed assumption of &blk_exp_nbd instead of drv in generic code [Max]
- Documented blk_exp_request_shutdown() better [Max]
- iotests 140: Fixed race between QMP return value and event [Max]
- Improved the commit message for patch 26
- Removed copy&paste error in deprecated.rst [Max]
- iotests: Take Sequence instead of positional arguments in qemu_tool_pipe_and_status() [Max]
- iotests: Separate patch for qemu_nbd_list_log [Max]
- iotests 307: [Max]
* Allow more image formats
* Use sock_dir for the socket
* Use f-strings instead of % operator
* Log events after deleting an export
* Test force removing an export

Kevin Wolf (31):
nbd: Remove unused nbd_export_get_blockdev()
qapi: Create block-export module
qapi: Rename BlockExport to BlockExportOptions block/export: Add BlockExport infrastructure and block-export-add
qemu-storage-daemon: Use qmp_block_export_add()
qemu-nbd: Use raw block driver for --offset block/export: Remove magic from block-export-add
nbd: Add max-connections to nbd-server-start
nbd: Add writethrough to block-export-add
nbd: Remove NBDExport.close callback
qemu-nbd: Use blk_exp_add() to create the export nbd/server: Simplify export shutdown
block/export: Move refcount from NBDExport to BlockExport block/export: Move AioContext from NBDExport to BlockExport block/export: Add node-name to BlockExportOptions block/export: Allocate BlockExport in blk_exp_add() block/export: Add blk_exp_close_all(_type) block/export: Add 'id' option to block-export-add block/export: Move strong user reference to block_exports block/export: Add block-export-del
block/export: Add BLOCK_EXPORT_DELETED event block/export: Move blk to BlockExport
block/export: Create BlockBackend in blk_exp_add() block/export: Add query-block-exports
block/export: Move writable to BlockExportOptions
nbd: Merge nbd_export_new() and nbd_export_create()
nbd: Deprecate nbd-server-add/remove
iotests: Factor out qemu_tool_pipe_and_status()
iotests: Introduce qemu_nbd_list_log()
iotests: Allow supported and unsupported formats at the same time
iotests: Test block-export-* QMP interface

 qapi/block-core.json                 | 166 --------------
 qapi/block-export.json               | 291 ++++++++++++++++++++++++
 qapi/qapi-schema.json                |   1 +
 docs/system/deprecated.rst           |   6 +
 include/block/export.h               |  89 ++++++++
 include/block/nbd.h                  |  22 +-
 block.c                              |   2 +-
 block/export/export.c                | 325 +++++++++++++++++++++++++++
 block/monitor/block-hmp-cmds.c       |  13 +-
 blockdev-nbd.c                       | 171 +++++++-------
 nbd/server.c                         | 309 +++++++++++--------------
 qemu-nbd.c                           |  67 +++---
 storage-daemon/qemu-storage-daemon.c |  27 +--
 tests/qemu-iotests/iotests.py        |  68 +++---
 block/export/meson.build             |   1 +
 block/meson.build                    |   2 +
 meson.build                          |   2 +-
 qapi/meson.build                     |   4 +-
 storage-daemon/qapi/qapi-schema.json |   1 +
 tests/qemu-iotests/140               |   9 +-
 tests/qemu-iotests/140.out           |   2 +-
 tests/qemu-iotests/223.out           |   8 +-
 tests/qemu-iotests/307               | 132 +++++++++++
 tests/qemu-iotests/307.out           | 124 ++++++++++
 tests/qemu-iotests/group             |   1 +
 25 files changed, 1311 insertions(+), 532 deletions(-)
 create mode 100644 qapi/block-export.json
 create mode 100644 include/block/export.h
 create mode 100644 block/export/export.c
 create mode 100644 block/export/meson.build
 create mode 100755 tests/qemu-iotests/307
 create mode 100644 tests/qemu-iotests/307.out
Signature · 1 line
2.25.4