Skip to content

block/export: convert vhost-user-blk-server to block exports API

Stefan Hajnoczi qemu-devel 2 versions – Applied

Status from this message: Thanks, applied to my block tree with a mention of the QAPI schema

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest13 patches 7 repliesApplied
  2. v111 patches 2 repliesSuperseded

Changes in v2 from the cover letter

* Replace unix-socket=str with addr=SocketAddress for consistency with NBD and fd passing support. The new syntax is:
--export vhost-user-blk,addr.type=unix,addr.path=/tmp/vhost-user-blk.sock,...
* Make addr=SocketAddress mandatory instead of optional [Markus]
* Update test-vhost-user-blk.c to use new syntax
* Add patch moving vhost-user-server.h to include/
* Add patch to use libvhost-user.a instead of compiling it multiple times

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/13block/export: shorten serial string to fitblock/export/vhost-user-blk-server.c+1 -10 replies
2/13util/vhost-user-server: s/fileds/fields/ typo fixutil/vhost-user-server.c+1 -10 replies
3/13util/vhost-user-server: drop unnecessary QOM castutil/vhost-user-server.c+1 -10 replies
4/13util/vhost-user-server: drop unnecessary watch deletionutil/vhost-user-server.c+4 -150 replies
5/13block/export: consolidate request structs into VuBlockReqblock/export/vhost-user-blk-server.c+21 -470 replies
6/13util/vhost-user-server: drop unused DevicePanicNotifierblock/export/vhost-user-blk-server.c util/vhost-user-server.c util/vhost-user-server.h+1 -110 replies
7/13util/vhost-user-server: fix memory leak in vu_message_read()util/vhost-user-server.c+23 -270 replies
8/13util/vhost-user-server: check EOF when reading payloadutil/vhost-user-server.c+4 -20 replies
9/13util/vhost-user-server: rework vu_client_trip() coroutine lifecycleblock/export/vhost-user-blk-server.c util/vhost-user-server.c util/vhost-user-server.h+155 -1280 replies
10/13block/export: report flush errorsblock/export/vhost-user-blk-server.c+7 -40 replies
11/13block/export: convert vhost-user-blk server to block export APIblock/export/export.c block/export/meson.build block/export/vhost-user-blk-server.c +5 more+158 -3606 replies
12/13util/vhost-user-server: move header to include/MAINTAINERS block/export/vhost-user-blk-server.c include/qemu/vhost-user-server.h +1 more+5 -30 replies
13/13util/vhost-user-server: use static library in meson.buildblock/export/export.c block/export/meson.build contrib/libvhost-user/meson.build +3 more+15 -80 replies

Reviews trailers per patch

1 of 13 patches has a Reviewed-by or Acked-by.

PatchMarkus Armbruster
1/13
2/13
3/13
4/13
5/13
6/13
7/13
8/13
9/13
10/13
11/13A-b
12/13
13/13

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

Read the v2 thread

Cover letter [PATCH v2 00/13] block/export: convert vhost-user-blk-server to block exports API

v2:
* Replace unix-socket=str with addr=SocketAddress for consistency with NBD and fd passing support. The new syntax is:
--export vhost-user-blk,addr.type=unix,addr.path=/tmp/vhost-user-blk.sock,...
* Make addr=SocketAddress mandatory instead of optional [Markus]
* Update test-vhost-user-blk.c to use new syntax
* Add patch moving vhost-user-server.h to include/
* Add patch to use libvhost-user.a instead of compiling it multiple times

This patch series converts Coiby Xu's vhost-user-blk-server from a QOM object to the block exports API. The block exports API provides a standard QMP and command-line interface for managing block exports (NBD, FUSE, vhost-user-blk, etc). A fair amount of init/shutdown code is removed because the block exports API already takes care of that functionality.

Most of the patches are vhost-user-blk-server cleanups.

The syntax for launching qemu-storage-daemon is:

  $ qemu-storage-daemon \
      --blockdev file,node-name=drive0,filename=test.img \
      --export vhost-user-blk,node-name=drive0,id=export0,writable=on,addr.type=unix,addr.path=/tmp/vhost-user-blk.sock

QEMU can connect to the vhost-user-blk export like this:

  $ qemu-system-x86_64 \
      -M accel=kvm,memory-backend=mem \
      -m 1G \
      -object memory-backend-memfd,size=1G,id=mem \
      -cpu host \
      -chardev socket,path=/tmp/vhost-user-blk.sock,id=char0 \
      -device vhost-user-blk-pci,chardev=char0

Based-on: [email protected] ("[PATCH v10 0/7] vhost-user block device backend implementation")
Based-on: [email protected] ("[PATCH 00/29] block/export: Add infrastructure and QAPI for block exports")

Stefan Hajnoczi (13):
block/export: shorten serial string to fit util/vhost-user-server: s/fileds/fields/ typo fix util/vhost-user-server: drop unnecessary QOM cast util/vhost-user-server: drop unnecessary watch deletion block/export: consolidate request structs into VuBlockReq util/vhost-user-server: drop unused DevicePanicNotifier util/vhost-user-server: fix memory leak in vu_message_read() util/vhost-user-server: check EOF when reading payload util/vhost-user-server: rework vu_client_trip() coroutine lifecycle block/export: report flush errors
block/export: convert vhost-user-blk server to block export API util/vhost-user-server: move header to include/ util/vhost-user-server: use static library in meson.build

 MAINTAINERS                                |   4 +-
 qapi/block-export.json                     |  21 +-
 block/export/vhost-user-blk-server.h       |  23 +-
 {util => include/qemu}/vhost-user-server.h |  32 +-
 block/export/export.c                      |   8 +-
 block/export/vhost-user-blk-server.c       | 525 ++++++---------------
 tests/qtest/vhost-user-blk-test.c          |   2 +-
 util/vhost-user-server.c                   | 334 ++++++-------
 block/export/meson.build                   |   1 +
 block/meson.build                          |   1 -
 contrib/libvhost-user/meson.build          |   1 +
 meson.build                                |   6 +-
 tests/qtest/meson.build                    |   2 +-
 util/meson.build                           |   4 +-
 14 files changed, 376 insertions(+), 588 deletions(-)
 rename {util => include/qemu}/vhost-user-server.h (72%)
Signature · 1 line
2.26.2