Skip to content

RFC block/export: Add infrastructure and QAPI for block exports

Kevin Wolf qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest22 patches 67 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/22nbd: Remove unused nbd_export_get_blockdev()include/block/nbd.h nbd/server.c+0 -72 replies
2/22qapi: Create block-export moduleblock/monitor/block-hmp-cmds.c blockdev-nbd.c include/block/nbd.h +6 more+181 -1712 replies
3/22qapi: Rename BlockExport to BlockExportOptionsblock/monitor/block-hmp-cmds.c blockdev-nbd.c qapi/block-export.json +1 more+14 -142 replies
4/22block/export: Add BlockExport infrastructure and block-export-addMakefile.objs block/Makefile.objs block/export/Makefile.objs +6 more+132 -126 replies
5/22qemu-storage-daemon: Use qmp_block_export_add()qemu-storage-daemon.c+1 -122 replies
6/22qemu-nbd: Use raw block driver for --offsetblockdev-nbd.c include/block/nbd.h nbd/server.c +1 more+32 -426 replies
7/22block/export: Remove magic from block-export-addblock/export/export.c blockdev-nbd.c include/block/nbd.h +2 more+58 -217 replies
8/22nbd: Add max-connections to nbd-server-startblock/monitor/block-hmp-cmds.c blockdev-nbd.c include/block/nbd.h +2 more+39 -134 replies
9/22nbd: Add writethrough to block-export-addblockdev-nbd.c qapi/block-export.json+7 -27 replies
10/22nbd: Remove NBDExport.close callbackblockdev-nbd.c include/block/nbd.h nbd/server.c +1 more+7 -212 replies
11/22qemu-nbd: Use blk_exp_add() to create the exportblock/export/export.c blockdev-nbd.c include/block/export.h +2 more+33 -84 replies
12/22nbd/server: Simplify export shutdownnbd/server.c+4 -132 replies
13/22block/export: Move refcount from NBDExport to BlockExportblock/export/export.c blockdev-nbd.c include/block/export.h +2 more+58 -423 replies
14/22block/export: Move AioContext from NBDExport to BlockExportinclude/block/export.h nbd/server.c+19 -133 replies
15/22block/export: Move device to BlockExportOptionsblock/export/export.c block/monitor/block-hmp-cmds.c blockdev-nbd.c +2 more+47 -184 replies
16/22block/export: Allocate BlockExport in blk_exp_add()block/export/export.c blockdev-nbd.c include/block/export.h +2 more+50 -351 reply
17/22block/export: Add blk_exp_close_all(_type)block.c block/export/export.c blockdev-nbd.c +4 more+68 -341 reply
18/22block/export: Add 'id' option to block-export-addblock/export/export.c include/block/export.h qapi/block-export.json +1 more+34 -01 reply
19/22block/export: Move strong user reference to block_exportsblock/export/export.c blockdev-nbd.c include/block/export.h +1 more+12 -74 replies
20/22block/export: Add block-export-delblock/export/export.c block/monitor/block-hmp-cmds.c blockdev-nbd.c +3 more+79 -501 reply
21/22block/export: Move blk to BlockExportblock/export/export.c include/block/export.h nbd/server.c+29 -211 reply
22/22block/export: Add query-block-exportsblock/export/export.c qapi/block-export.json+56 -02 replies

Reviews trailers per patch

17 of 22 patches have a Reviewed-by or Acked-by.

PatchMax ReitzEric Blake
1/22R-b R-b
2/22R-b R-b
3/22R-b R-b
4/22R-b
5/22R-b R-b
6/22R-b R-b
7/22
8/22R-b R-b
9/22
10/22R-b R-b
11/22R-b
12/22R-b R-b
13/22R-b
14/22R-b
15/22
16/22R-b
17/22R-b
18/22
19/22R-b
20/22R-b
21/22R-b
22/22

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 00/22] 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.

This series is still RFC because the patches aren't very polished (though they also shouldn't be too bad), it's not completely clear if more features should be moved from NBD to the BlockExport layer in this series (or maybe even less, and the rest dealt with in a separate series) and qemu-iotests cases for the new interfaces are still missing.

Kevin Wolf (22):
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: Move device 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: Move blk to BlockExport
block/export: Add query-block-exports

 qapi/block-core.json                 | 166 ---------------
 qapi/block-export.json               | 261 +++++++++++++++++++++++
 qapi/qapi-schema.json                |   1 +
 include/block/export.h               |  73 +++++++
 include/block/nbd.h                  |  25 +--
 block.c                              |   2 +-
 block/export/export.c                | 297 +++++++++++++++++++++++++++
 block/monitor/block-hmp-cmds.c       |  11 +-
 blockdev-nbd.c                       | 124 +++++------
 nbd/server.c                         | 243 +++++++++-------------
 qemu-nbd.c                           |  67 +++---
 qemu-storage-daemon.c                |  25 +--
 Makefile.objs                        |   6 +-
 block/Makefile.objs                  |   2 +
 block/export/Makefile.objs           |   1 +
 qapi/Makefile.objs                   |   5 +-
 storage-daemon/qapi/qapi-schema.json |   1 +
 17 files changed, 857 insertions(+), 453 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/Makefile.objs
Signature · 1 line
2.25.4