How to extend QEMU's vhost-user tests after implementing vhost-user-blk device backend

2019-11-13 Thread Coiby Xu
Hi, I've implemented vhost-user-blk device backend by following https://wiki.qemu.org/Google_Summer_of_Code_2019#vhost-user-blk_device_backend. But I'm not sure what kind of tests I should write or to extend to take advantage of implemented vhost-user-blk device backend. The existing two tests

[RFC] Implementing vhost-user-blk device backend

2019-11-18 Thread Coiby Xu
in the QEMU monitor. Signed-off-by: Coiby Xu --- Makefile.objs | 2 +- Makefile.target | 1 + blockdev-vhost.c | 664 ++ hmp-commands.hx | 27 ++ include/block/vhost.h | 5 + include/monitor/hmp.h | 2 + monitor/hmp-cmds.c

Re: How to extend QEMU's vhost-user tests after implementing vhost-user-blk device backend

2019-12-11 Thread Coiby Xu
! On Thu, Nov 14, 2019 at 7:14 PM Stefan Hajnoczi wrote: > > On Wed, Nov 13, 2019 at 05:23:46PM +0800, Coiby Xu wrote: > > I've implemented vhost-user-blk device backend by following > > https://wiki.qemu.org/Google_Summer_of_Code_2019#vhost-user-blk_device_backend. > > Bu

Failure of troublesome vhost-user/flags-mismatch test can't be reproduced

2019-10-27 Thread Coiby Xu
Hi, Can anyone reproduce the failure of one troublesome test vhost-user/flags-mismatch (https://wiki.qemu.org/Testing/CI/TroublesomeTests) which has been disabled since Aug 15 2017 ( https://patchwork.kernel.org/patch/9939431/)? Last month I downloaded QEMU source code (commit ID: 3483534ec3)

[PATCH v3 0/5] vhost-user block device backend implementation

2020-02-12 Thread Coiby Xu
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): extend libvhost to support IOThread and coroutine generic vhost user server vhost-

[PATCH v3 3/5] vhost-user block device backend server

2020-02-12 Thread Coiby Xu
By making use of libvhost, multiple block device drives can be exported and each drive can serve multiple clients simultaneously. Since vhost-user-server needs a block drive to be created first, delay the creation of this object. Signed-off-by: Coiby Xu --- Makefile.target

[PATCH v3 4/5] a standone-alone tool to directly share disk image file via vhost-user protocol

2020-02-12 Thread Coiby Xu
to replace this tool. Signed-off-by: Coiby Xu --- Makefile | 4 + configure | 3 + qemu-vu.c | 252 ++ 3 files changed, 259 insertions(+) create mode 100644 qemu-vu.c diff --git a/Makefile b/Makefile index f0e1a2fc1d..0bfd2f1ddd 100644

[PATCH v3 1/5] extend libvhost to support IOThread and coroutine

2020-02-12 Thread Coiby Xu
Previously libvhost dispatch events in its own GMainContext. Now vhost-user client's kick event can be dispatched in block device drive's AioContext thus IOThread is supported. And also allow vu_message_read and vu_kick_cb to be replaced so QEMU can run them as coroutines. Signed-off-by: Coiby Xu

[PATCH v3 2/5] generic vhost user server

2020-02-12 Thread Coiby Xu
Sharing QEMU devices via vhost-user protocol Signed-off-by: Coiby Xu --- util/Makefile.objs | 3 + util/vhost-user-server.c | 429 +++ util/vhost-user-server.h | 56 + 3 files changed, 489 insertions(+) create mode 100644 util/vhost-user

[PATCH v3 5/5] new qTest case to test the vhost-user-blk-server

2020-02-12 Thread Coiby Xu
This test case has the same tests as tests/virtio-blk-test.c except for tests have block_resize. Signed-off-by: Coiby Xu --- tests/libqos/vhost-user-blk.c | 126 ++ tests/libqos/vhost-user-blk.h | 44 +++ tests/vhost-user-blk-test.c | 694 ++ 3 files

Re: [PATCH v4 0/5] vhost-user block device backend implementation

2020-02-26 Thread Coiby Xu
u, Feb 20, 2020 at 1:58 AM Stefan Hajnoczi wrote: > > On Tue, Feb 18, 2020 at 01:07:06PM +0800, Coiby Xu wrote: > > v4: > > * add object properties in class_init > > * relocate vhost-user-blk-test > > * other changes including using SocketAddress, coding style, etc. &

Re: [PATCH v4 0/5] vhost-user block device backend implementation

2020-02-27 Thread Coiby Xu
reading from socket util getting enough bytes. I assume short read is a rare case thus introduced performance penalty would be negligible. On Thu, Feb 27, 2020 at 3:41 PM Stefan Hajnoczi wrote: > > On Wed, Feb 26, 2020 at 11:18:41PM +0800, Coiby Xu wrote: > > Hi Stefan, >

Re: [PATCH v4 0/5] vhost-user block device backend implementation

2020-02-27 Thread Coiby Xu
allow vu_message_read to be replaced by one which will depend on the main QEMU code. I'm not sure which way is better. On Thu, Feb 27, 2020 at 6:02 PM Kevin Wolf wrote: > > Am 27.02.2020 um 10:53 hat Coiby Xu geschrieben: > > Thank you for reminding me of this socket short read issue!

Re: [PATCH v4 2/5] generic vhost user server

2020-02-27 Thread Coiby Xu
function. In v5, I plan to use aio_set_fd_handler to set a read hander which is a wrapper for vu_kick_cb to deal with kick events since eventfd doesn't have the short read issue like socket. Thus vu_kick_cb in libvhost-user can be re-used. My only concern is if this could lead to worse performance in

Re: [PATCH v2 3/5] a standone-alone tool to directly share disk image file via vhost-user protocol

2020-01-31 Thread Coiby Xu
"? On Fri, Jan 17, 2020 at 6:12 PM Kevin Wolf wrote: > > Am 17.01.2020 um 09:12 hat Coiby Xu geschrieben: > > Excellent! I will add an option (or object property) for > > vhost-user-blk server oject which will tell the daemon process to exit > > when the client dis

[PATCH v4 5/5] new qTest case to test the vhost-user-blk-server

2020-02-17 Thread Coiby Xu
This test case has the same tests as tests/virtio-blk-test.c except for tests have block_resize. Signed-off-by: Coiby Xu --- tests/Makefile.include | 3 +- tests/qtest/Makefile.include| 2 + tests/qtest/libqos/vhost-user-blk.c | 126 + tests/qtest/libqos/vhost-user

[PATCH v4 2/5] generic vhost user server

2020-02-17 Thread Coiby Xu
Sharing QEMU devices via vhost-user protocol Signed-off-by: Coiby Xu --- util/Makefile.objs | 3 + util/vhost-user-server.c | 427 +++ util/vhost-user-server.h | 56 + 3 files changed, 486 insertions(+) create mode 100644 util/vhost-user

[PATCH v4 4/5] a standone-alone tool to directly share disk image file via vhost-user protocol

2020-02-17 Thread Coiby Xu
to replace this tool. Signed-off-by: Coiby Xu --- Makefile | 4 + configure | 3 + qemu-vu.c | 252 ++ 3 files changed, 259 insertions(+) create mode 100644 qemu-vu.c diff --git a/Makefile b/Makefile index b5a7377cb1..74fb109675 100644

[PATCH v4 3/5] vhost-user block device backend server

2020-02-17 Thread Coiby Xu
By making use of libvhost, multiple block device drives can be exported and each drive can serve multiple clients simultaneously. Since vhost-user-server needs a block drive to be created first, delay the creation of this object. Signed-off-by: Coiby Xu --- Makefile.target

[PATCH v4 0/5] vhost-user block device backend implementation

2020-02-17 Thread Coiby Xu
vhost-user block device after mouting it. Coiby Xu (5): extend libvhost to support IOThread and coroutine 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 vhos

[PATCH v4 1/5] extend libvhost to support IOThread and coroutine

2020-02-17 Thread Coiby Xu
Previously libvhost dispatch events in its own GMainContext. Now vhost-user client's kick event can be dispatched in block device drive's AioContext thus IOThread is supported. And also allow vu_message_read and vu_kick_cb to be replaced so QEMU can run them as coroutines. Signed-off-by: Coiby Xu

Re: [PATCH v2 1/5] vhost-user block device backend

2020-02-13 Thread Coiby Xu
n VubDev. Currently, I don't use chardev as an object property of vhost-user-blk-server. So actually multiple clients can be connected simutaneously. All the other suggestions have been adopted in v3. Thank you for your advice! On Thu, Jan 16, 2020 at 9:51 PM Stefan Hajnoczi wrote: > > On Tue

Re: [PATCH v2 1/5] vhost-user block device backend

2020-02-19 Thread Coiby Xu
v4 all suggestions have been applied. Thank you! On Thu, Jan 16, 2020 at 9:56 PM Kevin Wolf wrote: > > Hi, > > I'm only doing a quick first review pointing out the more obvious > things while I familiarise myself with your code. I intend to review it > in more detail later (eithe

Re: [PATCH v2 1/5] vhost-user block device backend

2020-02-20 Thread Coiby Xu
the more obvious > things while I familiarise myself with your code. I intend to review it > in more detail later (either in a second pass for this series, or when > you post v3). > > Am 14.01.2020 um 15:06 hat Coiby Xu geschrieben: > > By making use of libvhost, multipl

Re: [PATCH v2 3/5] a standone-alone tool to directly share disk image file via vhost-user protocol

2020-02-12 Thread Coiby Xu
es easier for implementing block-export-add QMP command. But in later versions, only object_add/object_del syntax is supported to start/stop vhost-user-blk-server. I'll keep an eye on how the storage daemon develops and adapt my code accordingly. On Sun, Feb 2, 2020 at 5:33 PM Kevin Wolf wro

Re: [PATCH v3 4/5] a standone-alone tool to directly share disk image file via vhost-user protocol

2020-02-12 Thread Coiby Xu
=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))} QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=./qemu-img QTEST_QEMU_VU_BINARY=./qemu-vu tests/qos-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="qos-test" On Wed, Feb 12, 2020 at 5:52 PM Co

[PATCH v1 0/5] vhost-user block device backend implementation

2020-01-12 Thread Coiby Xu
t -device vhost-user-blk-pci,id=blk0,chardev=char1 And guest OS could access this vhost-user block device after mouting it. patches are against commit 035eed4c0d257c905a556fa0f4865a0c077b4e7f. Coiby Xu (5): vhost-user block device backend extend libvhost to support IOThread a standone-

[PATCH v1 1/5] vhost-user block device backend

2020-01-12 Thread Coiby Xu
By making use of libvhost, multiple block device drives can be exported and each drive can serve multiple clients simultaneously. Since vhost-user-server needs a block drive to be created first, delay the creation of this object. Signed-off-by: Coiby Xu --- blockdev-vu.c | 1008

[PATCH v1 2/5] extend libvhost to support IOThread

2020-01-12 Thread Coiby Xu
Previously libvhost dispatch events in its own GMainContext. Now vhost-user client's kick event can be dispatched in block device drive's AioContext thus IOThread is supported. Signed-off-by: Coiby Xu --- contrib/libvhost-user/libvhost-user.c | 64 ++- contrib/libvhost

[PATCH v1 3/5] a standone-alone tool to directly share disk image file via vhost-user protocol

2020-01-12 Thread Coiby Xu
vhost-user-blk can have played as vhost-user backend but it only supports raw file and don't support VIRTIO_BLK_T_DISCARD and VIRTIO_BLK_T_WRITE_ZEROES operations on raw file (ioctl(fd, BLKDISCARD) is only valid for real block device). Signed-off-by: Coiby Xu --- qemu-vu.c | 264

[PATCH v1 5/5] building configuration files changes

2020-01-12 Thread Coiby Xu
Signed-off-by: Coiby Xu --- Makefile | 1 + Makefile.objs | 2 +- Makefile.target| 1 + configure | 2 +- tests/Makefile.include | 5 - 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6b5ad1121b..1b98201d29

[PATCH v1 4/5] new qTest case for the vhost-user-blk device backend

2020-01-12 Thread Coiby Xu
This test case has the same tests as tests/virtio-blk-test.c except for tests have block_resize. Signed-off-by: Coiby Xu --- tests/libqos/vhost-user-blk.c | 125 ++ tests/libqos/vhost-user-blk.h | 44 +++ tests/vhost-user-blk-test.c | 691 ++ 3 files

[PATCH v2 3/5] a standone-alone tool to directly share disk image file via vhost-user protocol

2020-01-14 Thread Coiby Xu
vhost-user-blk can have played as vhost-user backend but it only supports raw file and don't support VIRTIO_BLK_T_DISCARD and VIRTIO_BLK_T_WRITE_ZEROES operations on raw file (ioctl(fd, BLKDISCARD) is only valid for real block device). Signed-off-by: Coiby Xu --- qemu-vu.c | 264

[PATCH v2 0/5] vhost-user block device backend implementation

2020-01-14 Thread Coiby Xu
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. patches are against commit 035eed4c0d257c905a556fa0f4865a0c077b4e7f. Coiby Xu (5):

Re: [PATCH v1 0/5] vhost-user block device backend implementation

2020-01-14 Thread Coiby Xu
It fails MinGW because libvhost-user depends on eventfd which is a Linux-specific feature. Now fixed in v2. On Mon, Jan 13, 2020 at 1:21 PM wrote: > Patchew URL: > https://patchew.org/QEMU/20200113045704.12318-1-coiby...@gmail.com/ > > > > Hi, > > This series failed the docker-mingw@fedora

[PATCH v2 5/5] building configuration files changes

2020-01-14 Thread Coiby Xu
libvhost-user depends on sys/poll.h, sys/socket.h and eventfd. Although Windows has the equivalent Winsock, it doesn't have eventfd. So only enable this feature on Linux. Signed-off-by: Coiby Xu --- Makefile | 1 + Makefile.objs | 2 +- Makefile.target| 1

[PATCH v2 2/5] extend libvhost to support IOThread

2020-01-14 Thread Coiby Xu
Previously libvhost dispatch events in its own GMainContext. Now vhost-user client's kick event can be dispatched in block device drive's AioContext thus IOThread is supported. Signed-off-by: Coiby Xu --- contrib/libvhost-user/libvhost-user.c | 64 ++- contrib/libvhost

[PATCH v2 1/5] vhost-user block device backend

2020-01-14 Thread Coiby Xu
By making use of libvhost, multiple block device drives can be exported and each drive can serve multiple clients simultaneously. Since vhost-user-server needs a block drive to be created first, delay the creation of this object. Signed-off-by: Coiby Xu --- blockdev-vu.c | 1008

[PATCH v2 4/5] new qTest case for the vhost-user-blk device backend

2020-01-14 Thread Coiby Xu
This test case has the same tests as tests/virtio-blk-test.c except for tests have block_resize. Signed-off-by: Coiby Xu --- tests/libqos/vhost-user-blk.c | 125 ++ tests/libqos/vhost-user-blk.h | 44 +++ tests/vhost-user-blk-test.c | 691 ++ 3 files

Re: [PATCH v2 3/5] a standone-alone tool to directly share disk image file via vhost-user protocol

2020-01-17 Thread Coiby Xu
age of it? Or should I apply the RFC PATCHes to my working branch directly and submit them together with the patches on vhost-user-blk server feature when posting v3? On Thu, Jan 16, 2020 at 10:04 PM Stefan Hajnoczi wrote: > > On Tue, Jan 14, 2020 at 10:06:18PM +0800, Coiby Xu wrote: &

Re: How to extend QEMU's vhost-user tests after implementing vhost-user-blk device backend

2020-01-03 Thread Coiby Xu
:58 PM Stefan Hajnoczi wrote: > On Wed, Dec 11, 2019 at 11:25:32PM +0800, Coiby Xu wrote: > > I'm now writing the tests for vhost-user-blk device based on > > tests/virtio-blk-test.c. But block_resize command doesn't apply to > > vhost-user-blk device. > > > > Af

Re: [RFC] Implementing vhost-user-blk device backend

2020-01-04 Thread Coiby Xu
on1,mode=control,pretty=on It doesn't support multiple concurrent client connections because of the limitation of chardev/char-socket.c. On Thu, Dec 19, 2019 at 10:31 PM Stefan Hajnoczi wrote: > On Mon, Nov 18, 2019 at 10:27:28PM +0800, Coiby Xu wrote: > > Hi all, > > > > T

[PATCH v5 3/5] vhost-user block device backend server

2020-03-09 Thread Coiby Xu
By making use of libvhost, multiple block device drives can be exported and each drive can serve multiple clients simultaneously. Since vhost-user-server needs a block drive to be created first, delay the creation of this object. Signed-off-by: Coiby Xu --- block/Makefile.objs

[PATCH v5 0/5] vhost-user block device backend implementation

2020-03-09 Thread Coiby Xu
ock 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

[PATCH v5 4/5] a standone-alone tool to directly share disk image file via vhost-user protocol

2020-03-09 Thread Coiby Xu
this tool after his patches are merged into the mainline QEMU. Signed-off-by: Coiby Xu --- Makefile | 4 + configure | 3 + qemu-vu.c | 252 ++ 3 files changed, 259 insertions(+) create mode 100644 qemu-vu.c diff --git a/Makefile b/Makefile

[PATCH v5 2/5] generic vhost user server

2020-03-09 Thread Coiby Xu
Sharing QEMU devices via vhost-user protocol Signed-off-by: Coiby Xu --- util/Makefile.objs | 3 + util/vhost-user-server.c | 360 +++ util/vhost-user-server.h | 57 ++ 3 files changed, 420 insertions(+) create mode 100644 util/vhost-user

[PATCH v5 5/5] new qTest case to test the vhost-user-blk-server

2020-03-09 Thread Coiby Xu
This test case has the same tests as tests/virtio-blk-test.c except for tests have block_resize. Signed-off-by: Coiby Xu --- tests/Makefile.include | 3 +- tests/qtest/Makefile.include| 2 + tests/qtest/libqos/vhost-user-blk.c | 126 + tests/qtest/libqos/vhost-user

[PATCH v5 1/5] allow vu_message_read to be replaced

2020-03-09 Thread Coiby Xu
the event. When vu_kick_cb is trying to access vq->kick_fd, a segmentation fault will occur since vq has become a NULL pointer. Signed-off-by: Coiby Xu --- contrib/libvhost-user/libvhost-user-glib.c | 2 +- contrib/libvhost-user/libvhost-user.c | 11 ++- contrib/libvhost-user/libvh

Re: [PATCH v2 08/20] qemu-storage-daemon: Add --object option

2020-04-15 Thread Coiby Xu
Hi Kevin, I tried to start vhost-user block device backend server with the following command, $ qemu-storage-daemon --blockdev driver=file,node-name=disk,filename=file.img,read-only=off \ --object

Replace GSource with AioContext for chardev

2020-04-09 Thread Coiby Xu
Hi, I'm now implementing vhost-user block device backend https://patchew.org/QEMU/20200309100342.14921-1-coiby...@gmail.com/ and want to use chardev to help manage vhost-user client connections and read socket message. However there are two issues that need to be addressed. Firstly, chardev

Re: [PATCH v10 6/7] test: new qTest case to test the vhost-user-blk-server

2020-10-10 Thread Coiby Xu
On Wed, Sep 23, 2020 at 01:36:06PM +0100, Stefan Hajnoczi wrote: On Fri, Sep 18, 2020 at 04:09:11PM +0800, Coiby Xu wrote: +int qtest_socket_client(char *server_socket_path) +{ +struct sockaddr_un serv_addr; +int sock; +int ret; +int retries = 0; +sock = socket(PF_UNIX

Re: [PATCH v10 0/7] vhost-user block device backend implementation

2020-10-10 Thread Coiby Xu
On Fri, Oct 09, 2020 at 11:18:43AM +0100, Stefan Hajnoczi wrote: On Fri, Sep 18, 2020 at 04:09:05PM +0800, Coiby Xu wrote: v10 - Use a linked list of VuFdWatch objects to keep kick info [Stefan] - Merge improvements and fixes from Stefan - Rename libvhost-user's vu_message_read

Re: [PATCH v9 0/5] vhost-user block device backend implementation

2020-08-17 Thread Coiby Xu
On Thu, Jun 18, 2020 at 09:28:44AM +0100, Stefan Hajnoczi wrote: On Tue, Jun 16, 2020 at 02:52:16PM +0800, Coiby Xu wrote: On Sun, Jun 14, 2020 at 12:16:28PM -0700, no-re...@patchew.org wrote: > Patchew URL: https://patchew.org/QEMU/20200614183907.514282-1-coiby...@gmail.com/ > &g

Re: [PATCH v9 5/5] new qTest case to test the vhost-user-blk-server

2020-08-17 Thread Coiby Xu
On Wed, Jun 24, 2020 at 05:14:22PM +0200, Thomas Huth wrote: On 14/06/2020 20.39, Coiby Xu wrote: This test case has the same tests as tests/virtio-blk-test.c except for tests have block_resize. Since vhost-user server can only server one client one time, two instances of qemu-storage-daemon

Re: [PATCH v9 2/5] generic vhost user server

2020-08-17 Thread Coiby Xu
On Fri, Jun 19, 2020 at 01:13:00PM +0100, Stefan Hajnoczi wrote: On Mon, Jun 15, 2020 at 02:39:04AM +0800, Coiby Xu wrote: +/* + * a wrapper for vu_kick_cb + * + * since aio_dispatch can only pass one user data pointer to the + * callback function, pack VuDev and pvt into a struct. Then unpack

Re: [PATCH v9 2/5] generic vhost user server

2020-08-17 Thread Coiby Xu
On Thu, Jun 18, 2020 at 03:29:26PM +0200, Kevin Wolf wrote: Am 14.06.2020 um 20:39 hat Coiby Xu geschrieben: Sharing QEMU devices via vhost-user protocol. Only one vhost-user client can connect to the server one time. Signed-off-by: Coiby Xu --- util/Makefile.objs | 1 + util/vhost

Re: [PATCH 2/6] vhost-user-server: drop unused #include

2020-08-17 Thread Coiby Xu
On Fri, Jun 19, 2020 at 01:00:42PM +0100, Stefan Hajnoczi wrote: Signed-off-by: Stefan Hajnoczi --- util/vhost-user-server.c | 1 - 1 file changed, 1 deletion(-) diff --git a/util/vhost-user-server.c b/util/vhost-user-server.c index e94a8d8a83..49ada8bc78 100644 --- a/util/vhost-user-server.c

Should I delete created coroutines manually?

2020-08-17 Thread Coiby Xu
Hi, I'm working on vhost-user block device backend [1]. When I tested my patches on the latest version of QEMU (commit d0ed6a69d399ae193959225cdeaa9382746c91cc) with --enable-sanitizer turned on, the follow error will be thrown out, ==46631==ERROR: LeakSanitizer: detected memory leaks

Re: [PATCH v9 4/5] vhost-user block device backend server

2020-08-17 Thread Coiby Xu
On Thu, Jun 18, 2020 at 05:57:40PM +0200, Kevin Wolf wrote: Am 14.06.2020 um 20:39 hat Coiby Xu geschrieben: By making use of libvhost-user, block device drive can be shared to the connected vhost-user client. Only one client can connect to the server one time. Since vhost-user-server needs

[PATCH v10 1/7] libvhost-user: Allow vu_message_read to be replaced

2020-09-18 Thread Coiby Xu
Allow vu_message_read to be replaced by one which will make use of the QIOChannel functions. Thus reading vhost-user message won't stall the guest. For slave channel, we still use the default vu_message_read. Reviewed-by: Marc-André Lureau Signed-off-by: Coiby Xu --- contrib/libvhost-user

[PATCH v10 2/7] libvhost-user: remove watch for kick_fd when de-initialize vu-dev

2020-09-18 Thread Coiby Xu
When the client is running in gdb and quit command is run in gdb, QEMU will still dispatch the event which will cause segment fault in the callback function. Signed-off-by: Coiby Xu --- contrib/libvhost-user/libvhost-user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/libvhost

Re: [PATCH v9 0/5] vhost-user block device backend implementation

2020-09-18 Thread Coiby Xu
On Tue, Sep 15, 2020 at 04:35:57PM +0100, Stefan Hajnoczi wrote: On Mon, Jun 15, 2020 at 02:39:02AM +0800, Coiby Xu wrote: v9 - move logical block size check function to a utility function - fix issues regarding license, coding style, memory deallocation, etc. Hi, Any update on v10? Please

Re: Should I delete created coroutines manually?

2020-09-17 Thread Coiby Xu
On Tue, Aug 18, 2020 at 04:19:58PM +0100, Stefan Hajnoczi wrote: On Mon, Aug 17, 2020 at 2:13 PM Coiby Xu wrote: I'm working on vhost-user block device backend [1]. When I tested my patches on the latest version of QEMU (commit d0ed6a69d399ae193959225cdeaa9382746c91cc) with --enable-sanitizer

[PATCH v6 1/4] Allow vu_message_read to be replaced

2020-05-30 Thread Coiby Xu
Allow vu_message_read to be replaced by one which will make use of the QIOChannel functions. Thus reading vhost-user message won't stall the guest. Signed-off-by: Coiby Xu --- contrib/libvhost-user/libvhost-user-glib.c | 2 +- contrib/libvhost-user/libvhost-user.c | 11

[PATCH v6 3/4] vhost-user block device backend server

2020-05-30 Thread Coiby Xu
By making use of libvhost-user, block device drive can be shared to the connected vhost-user client. Only one client can connect to the server one time. Since vhost-user-server needs a block drive to be created first, delay the creation of this object. Signed-off-by: Coiby Xu --- block

[PATCH v6 4/4] new qTest case to test the vhost-user-blk-server

2020-05-30 Thread Coiby Xu
will send "quit" command to qemu-storage-daemon's QMP monitor. So a function is added to libqtest.c to establish socket connection with socket server. Signed-off-by: Coiby Xu --- tests/Makefile.include | 3 +- tests/qtest/Makefile.include| 2 + tests/qtest/li

[PATCH v6 0/4] vhost-user block device backend implementation

2020-05-30 Thread Coiby Xu
v6 - add missing license header and include guard - vhost-user server only serve one client one time - a bug fix in custom vu_message_read - using qemu-storage-daemon to start vhost-user-blk-server - a bug fix to pass docker-test-clang@ubuntu Coiby Xu (4): Allow vu_message_read

[PATCH v6 2/4] generic vhost user server

2020-05-30 Thread Coiby Xu
Sharing QEMU devices via vhost-user protocol. Only one vhost-user client can connect to the server one time. Signed-off-by: Coiby Xu --- util/Makefile.objs | 1 + util/vhost-user-server.c | 404 +++ util/vhost-user-server.h | 59 ++ 3 files

[PATCH v10 3/7] util/vhost-user-server: generic vhost user server

2020-09-18 Thread Coiby Xu
Sharing QEMU devices via vhost-user protocol. Only one vhost-user client can connect to the server one time. Suggested-by: Kevin Wolf Signed-off-by: Stefan Hajnoczi Signed-off-by: Coiby Xu --- util/meson.build | 1 + util/vhost-user-server.c | 428

[PATCH v10 0/7] vhost-user block device backend implementation

2020-09-18 Thread Coiby Xu
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 (7): libvhost-user: Allow vu_message_read to be replaced libvhost-user: remove watch for kick_fd when de-initialize vu-dev util/vhost-u

[PATCH v10 6/7] test: new qTest case to test the vhost-user-blk-server

2020-09-18 Thread Coiby Xu
, vhost-user-blk-server will send "quit" command to qemu-storage-daemon's QMP monitor. So a function is added to libqtest.c to establish socket connection with socket server. Suggested-by: Thomas Huth Signed-off-by: Coiby Xu --- tests/qtest/libqos/libqtest.h | 17 + tests/qt

[PATCH v10 4/7] block: move logical block size check function to a common utility function

2020-09-18 Thread Coiby Xu
Move the constants from hw/core/qdev-properties.c to util/block-helpers.h so that knowledge of the min/max values is Signed-off-by: Stefan Hajnoczi Signed-off-by: Coiby Xu --- hw/core/qdev-properties.c | 31 +- util/block-helpers.c | 46

[PATCH v10 5/7] block/export: vhost-user block device backend server

2020-09-18 Thread Coiby Xu
-by: Stefan Hajnoczi Signed-off-by: Coiby Xu --- block/export/vhost-user-blk-server.c | 661 +++ block/export/vhost-user-blk-server.h | 36 ++ block/meson.build| 1 + softmmu/vl.c | 4 + 4 files changed, 702 insertions(+) create

[PATCH v10 7/7] MAINTAINERS: Add vhost-user block device backend server maintainer

2020-09-18 Thread Coiby Xu
Suggested-by: Stefano Garzarella Signed-off-by: Coiby Xu --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3d17cad19a..55ad6abe73 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3039,6 +3039,14 @@ L: qemu-bl...@nongnu.org S: Supported F

Re: [PATCH v9 0/5] vhost-user block device backend implementation

2020-06-16 Thread Coiby Xu
On Sun, Jun 14, 2020 at 12:16:28PM -0700, no-re...@patchew.org wrote: Patchew URL: https://patchew.org/QEMU/20200614183907.514282-1-coiby...@gmail.com/ Hi, This series failed the asan build test. Please find the testing commands and their output below. If you have Docker installed, you can

Re: [PATCH v8 0/4] vhost-user block device backend implementation

2020-06-16 Thread Coiby Xu
On Mon, Jun 15, 2020 at 10:46:10AM +0200, Stefano Garzarella wrote: On Mon, Jun 15, 2020 at 02:46:40AM +0800, Coiby Xu wrote: Hi Stefano Garzarella, On Thu, Jun 11, 2020 at 02:37:03PM +0200, Stefano Garzarella wrote: > Hi Coiby Xu, > > On Fri, Jun 05, 2020 at 07:35:34AM +0800, Coiby

Re: [PATCH v9 0/5] vhost-user block device backend implementation

2020-06-23 Thread Coiby Xu
On Fri, Jun 19, 2020 at 01:07:46PM +0100, Stefan Hajnoczi wrote: On Mon, Jun 15, 2020 at 02:39:02AM +0800, Coiby Xu wrote: v9 - move logical block size check function to a utility function - fix issues regarding license, coding style, memory deallocation, etc. I have replied with patches

Re: [PATCH v9 5/5] new qTest case to test the vhost-user-blk-server

2020-06-23 Thread Coiby Xu
On Thu, Jun 18, 2020 at 04:17:51PM +0100, Stefan Hajnoczi wrote: On Mon, Jun 15, 2020 at 02:39:07AM +0800, Coiby Xu wrote: This test case has the same tests as tests/virtio-blk-test.c except for tests have block_resize. Since vhost-user server can only server one client one time, two instances

Re: [PATCH v8 0/4] vhost-user block device backend implementation

2020-06-14 Thread Coiby Xu
Hi Stefano Garzarella, On Thu, Jun 11, 2020 at 02:37:03PM +0200, Stefano Garzarella wrote: Hi Coiby Xu, On Fri, Jun 05, 2020 at 07:35:34AM +0800, Coiby Xu wrote: v8 - re-try connecting to socket server to fix asan error - fix license naming issue v7 - fix docker-test-debug@fedora errors

[PATCH v9 0/5] vhost-user block device backend implementation

2020-06-14 Thread Coiby Xu
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. C

[PATCH v9 2/5] generic vhost user server

2020-06-14 Thread Coiby Xu
Sharing QEMU devices via vhost-user protocol. Only one vhost-user client can connect to the server one time. Signed-off-by: Coiby Xu --- util/Makefile.objs | 1 + util/vhost-user-server.c | 400 +++ util/vhost-user-server.h | 61 ++ 3 files

[PATCH v9 3/5] move logical block size check function to a common utility function

2020-06-14 Thread Coiby Xu
Move logical block size check function in hw/core/qdev-properties.c:set_blocksize() to util/block-helpers.c Signed-off-by: Coiby Xu --- hw/core/qdev-properties.c | 18 +++ util/Makefile.objs| 1 + util/block-helpers.c | 46 +++ util

[PATCH v9 5/5] new qTest case to test the vhost-user-blk-server

2020-06-14 Thread Coiby Xu
will send "quit" command to qemu-storage-daemon's QMP monitor. So a function is added to libqtest.c to establish socket connection with socket server. Signed-off-by: Coiby Xu --- tests/Makefile.include | 3 +- tests/qtest/Makefile.include| 2 + tests/qtest/li

Re: [PATCH v8 2/4] generic vhost user server

2020-06-14 Thread Coiby Xu
On Thu, Jun 11, 2020 at 02:14:49PM +0100, Stefan Hajnoczi wrote: On Fri, Jun 05, 2020 at 07:35:36AM +0800, Coiby Xu wrote: +static bool coroutine_fn +vu_message_read(VuDev *vu_dev, int conn_fd, VhostUserMsg *vmsg) +{ +struct iovec iov = { +.iov_base = (char *)vmsg, +.iov_len

[PATCH v9 1/5] Allow vu_message_read to be replaced

2020-06-14 Thread Coiby Xu
Allow vu_message_read to be replaced by one which will make use of the QIOChannel functions. Thus reading vhost-user message won't stall the guest. Signed-off-by: Coiby Xu --- contrib/libvhost-user/libvhost-user-glib.c | 2 +- contrib/libvhost-user/libvhost-user.c | 11

[PATCH v9 4/5] vhost-user block device backend server

2020-06-14 Thread Coiby Xu
By making use of libvhost-user, block device drive can be shared to the connected vhost-user client. Only one client can connect to the server one time. Since vhost-user-server needs a block drive to be created first, delay the creation of this object. Signed-off-by: Coiby Xu --- block

Re: [PATCH v9 0/5] vhost-user block device backend implementation

2020-06-25 Thread Coiby Xu
On Fri, Jun 19, 2020 at 01:07:46PM +0100, Stefan Hajnoczi wrote: On Mon, Jun 15, 2020 at 02:39:02AM +0800, Coiby Xu wrote: v9 - move logical block size check function to a utility function - fix issues regarding license, coding style, memory deallocation, etc. I have replied with patches

Re: [PATCH v9 1/5] Allow vu_message_read to be replaced

2020-06-23 Thread Coiby Xu
On Thu, Jun 18, 2020 at 12:43:47PM +0200, Kevin Wolf wrote: Am 14.06.2020 um 20:39 hat Coiby Xu geschrieben: Allow vu_message_read to be replaced by one which will make use of the QIOChannel functions. Thus reading vhost-user message won't stall the guest. Signed-off-by: Coiby Xu

Re: [PATCH v9 0/5] vhost-user block device backend implementation

2020-06-23 Thread Coiby Xu
On Thu, Jun 18, 2020 at 09:27:48AM +0100, Stefan Hajnoczi wrote: On Tue, Jun 16, 2020 at 02:52:16PM +0800, Coiby Xu wrote: On Sun, Jun 14, 2020 at 12:16:28PM -0700, no-re...@patchew.org wrote: > Patchew URL: https://patchew.org/QEMU/20200614183907.514282-1-coiby...@gmail.com/ > &g

Re: [PATCH v2 08/20] qemu-storage-daemon: Add --object option

2020-06-09 Thread Coiby Xu
On Mon, Feb 24, 2020 at 03:29:56PM +0100, Kevin Wolf wrote: Add a command line option to create user-creatable QOM objects. Signed-off-by: Kevin Wolf --- qemu-storage-daemon.c | 47 +++ Makefile.objs | 2 +- qom/Makefile.objs | 1 + 3 files

[PATCH v7 2/4] generic vhost user server

2020-06-04 Thread Coiby Xu
Sharing QEMU devices via vhost-user protocol. Only one vhost-user client can connect to the server one time. Signed-off-by: Coiby Xu --- util/Makefile.objs | 1 + util/vhost-user-server.c | 406 +++ util/vhost-user-server.h | 59 ++ 3 files

[PATCH v7 4/4] new qTest case to test the vhost-user-blk-server

2020-06-04 Thread Coiby Xu
will send "quit" command to qemu-storage-daemon's QMP monitor. So a function is added to libqtest.c to establish socket connection with socket server. Signed-off-by: Coiby Xu --- tests/Makefile.include | 3 +- tests/qtest/Makefile.include| 2 + tests/qtest/li

[PATCH v7 3/4] vhost-user block device backend server

2020-06-04 Thread Coiby Xu
By making use of libvhost-user, block device drive can be shared to the connected vhost-user client. Only one client can connect to the server one time. Since vhost-user-server needs a block drive to be created first, delay the creation of this object. Signed-off-by: Coiby Xu --- block

[PATCH v7 0/4] vhost-user block device backend implementation

2020-06-04 Thread Coiby Xu
this vhost-user block device after mounting it. Coiby Xu (5): allow vu_message_read to be replaced generic vhost user server vhost-user block device backend server new qTest case to test the vhost-user-blk-server block/Makefile.objs| 1 + block/export/vhos

[PATCH v7 1/4] Allow vu_message_read to be replaced

2020-06-04 Thread Coiby Xu
Allow vu_message_read to be replaced by one which will make use of the QIOChannel functions. Thus reading vhost-user message won't stall the guest. Signed-off-by: Coiby Xu --- contrib/libvhost-user/libvhost-user-glib.c | 2 +- contrib/libvhost-user/libvhost-user.c | 11

Re: [PATCH v6 4/4] new qTest case to test the vhost-user-blk-server

2020-06-04 Thread Coiby Xu
On Thu, Jun 04, 2020 at 03:49:13PM +0200, Thomas Huth wrote: On 04/06/2020 15.42, Thomas Huth wrote: + * Copyright (c) 2018 Emanuele Giuseppe Esposito Don't you want to add a remark here for you, too? + * This library is free software; you can redistribute it and/or + * modify it under the

[PATCH v8 2/4] generic vhost user server

2020-06-04 Thread Coiby Xu
Sharing QEMU devices via vhost-user protocol. Only one vhost-user client can connect to the server one time. Signed-off-by: Coiby Xu --- util/Makefile.objs | 1 + util/vhost-user-server.c | 406 +++ util/vhost-user-server.h | 59 ++ 3 files

[PATCH v8 1/4] Allow vu_message_read to be replaced

2020-06-04 Thread Coiby Xu
Allow vu_message_read to be replaced by one which will make use of the QIOChannel functions. Thus reading vhost-user message won't stall the guest. Signed-off-by: Coiby Xu --- contrib/libvhost-user/libvhost-user-glib.c | 2 +- contrib/libvhost-user/libvhost-user.c | 11

[PATCH v8 0/4] vhost-user block device backend implementation

2020-06-04 Thread Coiby Xu
ost.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 (4): Allow vu_message_read to be replaced generic vhost user server vhost-user block device backend server new qTest case to test the vhost-user-

[PATCH v8 4/4] new qTest case to test the vhost-user-blk-server

2020-06-04 Thread Coiby Xu
will send "quit" command to qemu-storage-daemon's QMP monitor. So a function is added to libqtest.c to establish socket connection with socket server. Signed-off-by: Coiby Xu --- tests/Makefile.include | 3 +- tests/qtest/Makefile.include| 2 + tests/qtest/li

  1   2   >