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

v9
 - move logical block size check function to a utility function
 - fix issues regarding license, coding style, memory deallocation, etc.

v8
 - re-try connecting to socket server to fix asan error
 - fix license naming issue

v7
 - fix docker-test-debug@fedora errors by freeing malloced memory

v6
 - add missing license header and include guard
 - vhost-user server only serve one client one time
 - fix a bug in custom vu_message_read
 - using qemu-storage-daemon to start vhost-user-blk-server
 - a bug fix to pass docker-test-clang@ubuntu

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 feature 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,logical-block-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,logical-block-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 mounting it.


Coiby Xu (5):
  Allow vu_message_read to be replaced
  generic vhost user server
  move logical block size check function to a common utility function
  vhost-user block device backend server
  new qTest case to test the vhost-user-blk-server

 block/Makefile.objs                        |   1 +
 block/export/vhost-user-blk-server.c       | 669 +++++++++++++++++++
 block/export/vhost-user-blk-server.h       |  35 +
 contrib/libvhost-user/libvhost-user-glib.c |   2 +-
 contrib/libvhost-user/libvhost-user.c      |  11 +-
 contrib/libvhost-user/libvhost-user.h      |  21 +
 hw/core/qdev-properties.c                  |  18 +-
 softmmu/vl.c                               |   4 +
 tests/Makefile.include                     |   3 +-
 tests/qtest/Makefile.include               |   2 +
 tests/qtest/libqos/vhost-user-blk.c        | 130 ++++
 tests/qtest/libqos/vhost-user-blk.h        |  48 ++
 tests/qtest/libqtest.c                     |  35 +-
 tests/qtest/libqtest.h                     |  17 +
 tests/qtest/vhost-user-blk-test.c          | 739 +++++++++++++++++++++
 tests/vhost-user-bridge.c                  |   2 +
 tools/virtiofsd/fuse_virtio.c              |   4 +-
 util/Makefile.objs                         |   2 +
 util/block-helpers.c                       |  46 ++
 util/block-helpers.h                       |   7 +
 util/vhost-user-server.c                   | 400 +++++++++++
 util/vhost-user-server.h                   |  61 ++
 22 files changed, 2231 insertions(+), 26 deletions(-)
 create mode 100644 block/export/vhost-user-blk-server.c
 create mode 100644 block/export/vhost-user-blk-server.h
 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/block-helpers.c
 create mode 100644 util/block-helpers.h
 create mode 100644 util/vhost-user-server.c
 create mode 100644 util/vhost-user-server.h

--
2.27.0



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

end of thread, other threads:[~2020-09-18  8:21 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-14 18:39 [PATCH v9 0/5] vhost-user block device backend implementation Coiby Xu
2020-06-14 18:39 ` [PATCH v9 1/5] Allow vu_message_read to be replaced Coiby Xu
2020-06-18 10:43   ` Kevin Wolf
2020-06-24  3:36     ` Coiby Xu
2020-06-24 12:24       ` Kevin Wolf
2020-06-14 18:39 ` [PATCH v9 2/5] generic vhost user server Coiby Xu
2020-06-18 13:29   ` Kevin Wolf
2020-08-17  8:59     ` Coiby Xu
2020-06-19 12:00   ` [PATCH 1/6] vhost-user-server: fix VHOST_MEMORY_MAX_REGIONS compiler error Stefan Hajnoczi
2020-06-19 12:00     ` [PATCH 2/6] vhost-user-server: drop unused #include <eventfd.h> Stefan Hajnoczi
2020-08-17 12:49       ` Coiby Xu
2020-08-18 15:11         ` Stefan Hajnoczi
2020-06-19 12:00     ` [PATCH 3/6] vhost-user-server: adjust vhost_user_server_set_aio_context() arguments Stefan Hajnoczi
2020-06-19 12:00     ` [PATCH 4/6] vhost-user-server: mark fd handlers "external" Stefan Hajnoczi
2020-06-19 12:00     ` [PATCH 5/6] vhost-user-server: fix s/initialized/initialize/ typo Stefan Hajnoczi
2020-06-19 12:00     ` [PATCH 6/6] vhost-user-server: use DevicePanicNotifierFn everywhere Stefan Hajnoczi
2020-06-19 12:13   ` [PATCH v9 2/5] generic vhost user server Stefan Hajnoczi
2020-08-17  8:24     ` Coiby Xu
2020-06-14 18:39 ` [PATCH v9 3/5] move logical block size check function to a common utility function Coiby Xu
2020-06-18 13:44   ` Kevin Wolf
2020-06-19 12:01   ` [PATCH 1/6] block-helpers: move MIN/MAX_BLOCK_SIZE constants into header file Stefan Hajnoczi
2020-06-19 12:01     ` [PATCH 2/6] block-helpers: switch to int64_t block size values Stefan Hajnoczi
2020-06-19 12:01     ` [PATCH 3/6] block-helpers: rename check_logical_block_size() to check_block_size() Stefan Hajnoczi
2020-06-19 12:01     ` [PATCH 4/6] block-helpers: use local_err in case errp is NULL Stefan Hajnoczi
2020-06-19 12:01     ` [PATCH 5/6] block-helpers: keep the copyright line from the original file Stefan Hajnoczi
2020-06-19 12:01     ` [PATCH 6/6] block-helpers: update doc comment in gtkdoc style Stefan Hajnoczi
2020-06-14 18:39 ` [PATCH v9 4/5] vhost-user block device backend server Coiby Xu
2020-06-18 15:57   ` Kevin Wolf
2020-08-17 12:30     ` Coiby Xu
2020-06-19 12:03   ` [PATCH 1/2] vhost-user-blk-server: adjust vhost_user_server_set_aio_context() arguments Stefan Hajnoczi
2020-06-19 12:03     ` [PATCH 2/2] vhost-user-blk-server: rename check_logical_block_size() to check_block_size() Stefan Hajnoczi
2020-06-14 18:39 ` [PATCH v9 5/5] new qTest case to test the vhost-user-blk-server Coiby Xu
2020-06-18 15:17   ` Stefan Hajnoczi
2020-06-24  4:35     ` Coiby Xu
2020-06-24 10:49       ` Stefan Hajnoczi
2020-06-24 15:14   ` Thomas Huth
2020-08-17  8:16     ` Coiby Xu
2020-06-14 19:12 ` [PATCH v9 0/5] vhost-user block device backend implementation no-reply
2020-06-14 19:16 ` no-reply
2020-06-16  6:52   ` Coiby Xu
2020-06-18  8:27     ` Stefan Hajnoczi
2020-06-24  4:00       ` Coiby Xu
2020-06-18  8:28     ` Stefan Hajnoczi
2020-08-17  8:23       ` Coiby Xu
2020-06-19 12:07 ` Stefan Hajnoczi
2020-06-24  4:48   ` Coiby Xu
2020-06-25 12:46   ` Coiby Xu
2020-06-26 15:46     ` Stefan Hajnoczi
2020-08-18 15:13 ` Stefan Hajnoczi
2020-09-15 15:35 ` Stefan Hajnoczi
2020-09-18  8:13   ` Coiby Xu

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).