qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/5] vhost-user block device backend implementation
@ 2020-03-09 10:03 Coiby Xu
  2020-03-09 10:03 ` [PATCH v5 1/5] allow vu_message_read to be replaced Coiby Xu
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Coiby Xu @ 2020-03-09 10:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, bharatlkmlkvm, Coiby Xu, stefanha

v5:
 * re-use vu_kick_cb in libvhost-user
 * keeping processing VhostUserMsg in the same coroutine until there is
   detachment/attachment of AIOContext
 * Spawn separate coroutine for each VuVirtqElement
 * Other changes including relocating vhost-user-blk-server.c, coding
   style etc.

v4:
 * add object properties in class_init
 * relocate vhost-user-blk-test
 * other changes including using SocketAddress, coding style, etc.

v3:
 * separate generic vhost-user-server code from vhost-user-blk-server
   code
 * re-write vu_message_read and kick hander function as coroutines to
   directly call blk_co_preadv, blk_co_pwritev, etc.
 * add aio_context notifier functions to support multi-threading model
 * other fixes regarding coding style, warning report, etc.

v2:
 * Only enable this feauture for Linux because eventfd is a Linux-specific
   feature


This patch series is an implementation of vhost-user block device
backend server, thanks to Stefan and Kevin's guidance.

Vhost-user block device backend server is a UserCreatable object and can be
started using object_add,

 (qemu) object_add vhost-user-blk-server,id=ID,unix-socket=/tmp/vhost-user-blk_vhost.socket,node-name=DRIVE_NAME,writable=off,blk-size=512
 (qemu) object_del ID

or appending the "-object" option when starting QEMU,

  $ -object vhost-user-blk-server,id=disk,unix-socket=/tmp/vhost-user-blk_vhost.socket,node-name=DRIVE_NAME,writable=off,blk-size=512

Then vhost-user client can connect to the server backend.
For example, QEMU could act as a client,

  $ -m 256 -object memory-backend-memfd,id=mem,size=256M,share=on -numa node,memdev=mem -chardev socket,id=char1,path=/tmp/vhost-user-blk_vhost.socket -device vhost-user-blk-pci,id=blk0,chardev=char1

And guest OS could access this vhost-user block device after mouting it.

Coiby Xu (5):
  allow vu_message_read to be replaced
  generic vhost user server
  vhost-user block device backend server
  a standone-alone tool to directly share disk image file via vhost-user
    protocol
  new qTest case to test the vhost-user-blk-server

 Makefile                                   |   4 +
 block/Makefile.objs                        |   3 +
 block/export/vhost-user-blk-server.c       | 727 +++++++++++++++++++++
 block/export/vhost-user-blk-server.h       |  21 +
 configure                                  |   3 +
 contrib/libvhost-user/libvhost-user-glib.c |   2 +-
 contrib/libvhost-user/libvhost-user.c      |  10 +-
 contrib/libvhost-user/libvhost-user.h      |   6 +
 qemu-vu.c                                  | 252 +++++++
 softmmu/vl.c                               |   4 +
 tests/Makefile.include                     |   3 +-
 tests/qtest/Makefile.include               |   2 +
 tests/qtest/libqos/vhost-user-blk.c        | 126 ++++
 tests/qtest/libqos/vhost-user-blk.h        |  44 ++
 tests/qtest/vhost-user-blk-test.c          | 694 ++++++++++++++++++++
 tests/vhost-user-bridge.c                  |   2 +
 tools/virtiofsd/fuse_virtio.c              |   4 +-
 util/Makefile.objs                         |   3 +
 util/vhost-user-server.c                   | 360 ++++++++++
 util/vhost-user-server.h                   |  57 ++
 20 files changed, 2318 insertions(+), 9 deletions(-)
 create mode 100644 block/export/vhost-user-blk-server.c
 create mode 100644 block/export/vhost-user-blk-server.h
 create mode 100644 qemu-vu.c
 create mode 100644 tests/qtest/libqos/vhost-user-blk.c
 create mode 100644 tests/qtest/libqos/vhost-user-blk.h
 create mode 100644 tests/qtest/vhost-user-blk-test.c
 create mode 100644 util/vhost-user-server.c
 create mode 100644 util/vhost-user-server.h

--
2.25.1



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-05-04 15:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-09 10:03 [PATCH v5 0/5] vhost-user block device backend implementation Coiby Xu
2020-03-09 10:03 ` [PATCH v5 1/5] allow vu_message_read to be replaced Coiby Xu
2020-03-23 14:50   ` Stefan Hajnoczi
2020-03-09 10:03 ` [PATCH v5 2/5] generic vhost user server Coiby Xu
2020-03-23 16:04   ` Stefan Hajnoczi
2020-03-09 10:03 ` [PATCH v5 3/5] vhost-user block device backend server Coiby Xu
2020-03-09 10:03 ` [PATCH v5 4/5] a standone-alone tool to directly share disk image file via vhost-user protocol Coiby Xu
2020-03-09 10:03 ` [PATCH v5 5/5] new qTest case to test the vhost-user-blk-server Coiby Xu
2020-03-09 10:49 ` [PATCH v5 0/5] vhost-user block device backend implementation no-reply
2020-05-04 15:49 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).