Re: [PATCH 2/4] libvduse: Replace strcpy() with strncpy()

2022-06-27 Thread Yongji Xie
On Tue, Jun 28, 2022 at 8:26 AM Richard Henderson wrote: > > On 6/27/22 14:32, Xie Yongji wrote: > > -strcpy(dev_config->name, name); > > +strncpy(dev_config->name, name, VDUSE_NAME_MAX); > > +dev_config->name[VDUSE_NAME_MAX - 1] = '\0'; >

Re: [PATCH 4/4] libvduse: Check the return value of some ioctls

2022-06-29 Thread Yongji Xie
On Wed, Jun 29, 2022 at 5:41 PM Markus Armbruster wrote: > > Xie Yongji writes: > > > Coverity pointed out (CID 1490222, 1490227) that we called > > ioctl somewhere without checking the return value. This > > patch fixes these issues. > > > > Fixes: Cover

Re: [PATCH 4/4] libvduse: Check the return value of some ioctls

2022-06-29 Thread Yongji Xie
On Wed, Jun 29, 2022 at 7:39 PM Markus Armbruster wrote: > > Yongji Xie writes: > > > On Wed, Jun 29, 2022 at 5:41 PM Markus Armbruster wrote: > >> > >> Xie Yongji writes: > >> > >> > Coverity pointed out (CID 1490222, 1490227) that we cal

Re: [PATCH 4/4] libvduse: Check the return value of some ioctls

2022-06-29 Thread Yongji Xie
On Wed, Jun 29, 2022 at 9:22 PM Markus Armbruster wrote: > > Yongji Xie writes: > > > On Wed, Jun 29, 2022 at 7:39 PM Markus Armbruster wrote: > >> > >> Yongji Xie writes: > >> > >> > On Wed, Jun 29, 2022 at 5:41 PM Markus Armbrus

Re: [PATCH v3 13/20] block/export: rewrite vduse-blk drain code

2023-04-20 Thread Yongji Xie
Hi Stefan, On Thu, Apr 20, 2023 at 7:39 PM Stefan Hajnoczi wrote: > > vduse_blk_detach_ctx() waits for in-flight requests using > AIO_WAIT_WHILE(). This is not allowed according to a comment in > bdrv_set_aio_context_commit(): > > /* >* Take the old AioContex when detaching it from bs. >

Re: [PATCH v3 13/20] block/export: rewrite vduse-blk drain code

2023-04-25 Thread Yongji Xie
On Wed, Apr 26, 2023 at 12:43 AM Stefan Hajnoczi wrote: > > On Fri, Apr 21, 2023 at 11:36:02AM +0800, Yongji Xie wrote: > > Hi Stefan, > > > > On Thu, Apr 20, 2023 at 7:39 PM Stefan Hajnoczi wrote: > > > > > > vduse_blk_detach_ctx() waits for in-flight r

Re: [PATCH 1/5] linux-headers: Add vduse.h

2022-02-07 Thread Yongji Xie
On Mon, Feb 7, 2022 at 9:12 PM Stefan Hajnoczi wrote: > > On Tue, Jan 25, 2022 at 09:17:56PM +0800, Xie Yongji wrote: > > diff --git a/scripts/update-linux-headers.sh > > b/scripts/update-linux-headers.sh > > index fea4d6eb65..4c7846076f 100755 > > --- a/scripts/upd

Re: [PATCH 2/5] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-02-07 Thread Yongji Xie
On Mon, Feb 7, 2022 at 10:01 PM Stefan Hajnoczi wrote: > > On Tue, Jan 25, 2022 at 09:17:57PM +0800, Xie Yongji wrote: > > VDUSE [1] is a linux framework that makes it possible to implement > > software-emulated vDPA devices in userspace. This adds a library > >

Re: [PATCH 3/5] vduse-blk: implements vduse-blk export

2022-02-07 Thread Yongji Xie
On Mon, Feb 7, 2022 at 10:15 PM Stefan Hajnoczi wrote: > > On Tue, Jan 25, 2022 at 09:17:58PM +0800, Xie Yongji wrote: > > This implements a VDUSE block backends based on > > the libvduse library. We can use it to export the BDSs > > for both VM and container (host) usage.

Re: [PATCH 4/5] vduse-blk: Add vduse-blk resize support

2022-02-08 Thread Yongji Xie
On Mon, Feb 7, 2022 at 10:18 PM Stefan Hajnoczi wrote: > > On Tue, Jan 25, 2022 at 09:17:59PM +0800, Xie Yongji wrote: > > To support block resize, this uses vduse_dev_update_config() > > to update the capacity field in configuration space and inject > > config inter

Re: [PATCH 5/5] libvduse: Add support for reconnecting

2022-02-08 Thread Yongji Xie
On Mon, Feb 7, 2022 at 10:39 PM Stefan Hajnoczi wrote: > > On Tue, Jan 25, 2022 at 09:18:00PM +0800, Xie Yongji wrote: > > To support reconnecting after restart or crash, VDUSE backend > > might need to resubmit inflight I/Os. This stores the metadata > > such as the

Re: [PATCH 5/5] libvduse: Add support for reconnecting

2022-02-08 Thread Yongji Xie
On Tue, Feb 8, 2022 at 4:09 PM Stefan Hajnoczi wrote: > > On Tue, Feb 08, 2022 at 03:35:27PM +0800, Yongji Xie wrote: > > On Mon, Feb 7, 2022 at 10:39 PM Stefan Hajnoczi wrote: > > > > > > On Tue, Jan 25, 2022 at 09:18:00PM +0800, Xie Yongji wrote: > > > &

[PATCH 1/2] libvhost-user: Add vu_notify_config_change() to support config change notify

2022-01-21 Thread Xie Yongji
This adds a new API vu_notify_config_change() to support sending VHOST_USER_SLAVE_CONFIG_CHANGE_MSG message to notify that the configuration space has changed. Signed-off-by: Xie Yongji --- subprojects/libvhost-user/libvhost-user.c | 20 subprojects/libvhost-user/libvhost

[PATCH 2/2] block/export: Add vhost-user-blk resize support

2022-01-21 Thread Xie Yongji
To support block resize, this updates the capacity field in configuration space and use vu_notify_config_change() to notify the vhost-user master on the block resize callback. Signed-off-by: Xie Yongji --- block/export/vhost-user-blk-server.c | 16 1 file changed, 16 insertions

[PATCH 2/5] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-01-25 Thread Xie Yongji
VDUSE [1] is a linux framework that makes it possible to implement software-emulated vDPA devices in userspace. This adds a library as a subproject to help implementing VDUSE backends in QEMU. [1] https://www.kernel.org/doc/html/latest/userspace-api/vduse.html Signed-off-by: Xie Yongji

[PATCH 3/5] vduse-blk: implements vduse-blk export

2022-01-25 Thread Xie Yongji
emon. Signed-off-by: Xie Yongji --- block/export/export.c | 6 + block/export/meson.build | 5 + block/export/vduse-blk.c | 427 ++ block/export/vduse-blk.h | 20 ++ meson.build | 13 ++ meson_options.txt

[PATCH 5/5] libvduse: Add support for reconnecting

2022-01-25 Thread Xie Yongji
To support reconnecting after restart or crash, VDUSE backend might need to resubmit inflight I/Os. This stores the metadata such as the index of inflight I/O's descriptors to a shm file so that VDUSE backend can restore them during reconnecting. Signed-off-by: Xie Yongji --- block/export/

[PATCH 1/5] linux-headers: Add vduse.h

2022-01-25 Thread Xie Yongji
This adds vduse header to standard headers so that the relevant VDUSE API can be used in subsequent patches. Signed-off-by: Xie Yongji --- include/standard-headers/linux/vduse.h | 306 + scripts/update-linux-headers.sh| 1 + 2 files changed, 307 insertions

[PATCH 0/5] Support exporting BDSs via VDUSE

2022-01-25 Thread Xie Yongji
x27;t support vdpa-blk in QEMU currently, the VM case is tested with my previous patchset [2]. [1] https://www.kernel.org/doc/html/latest/userspace-api/vduse.html [2] https://www.mail-archive.com/qemu-devel@nongnu.org/msg797569.html Please review, thanks! Xie Yongji (5): headers: Add vd

[PATCH 4/5] vduse-blk: Add vduse-blk resize support

2022-01-25 Thread Xie Yongji
To support block resize, this uses vduse_dev_update_config() to update the capacity field in configuration space and inject config interrupt on the block resize callback. Signed-off-by: Xie Yongji --- block/export/vduse-blk.c | 19 +++ 1 file changed, 19 insertions(+) diff

Re: [PATCH v5 0/8] Support exporting BDSs via VDUSE

2022-05-17 Thread Yongji Xie
On Fri, May 13, 2022 at 6:03 PM Michael S. Tsirkin wrote: > > On Wed, May 04, 2022 at 03:40:43PM +0800, Xie Yongji wrote: > > Hi all, > > > > Last few months ago, VDUSE (vDPA Device in Userspace) [1] has > > been merged into Linux kernel as a framework that make it

Re: [PATCH v5 2/8] block-backend: Introduce blk_get_guest_block_size()

2022-05-19 Thread Yongji Xie
On Wed, May 18, 2022 at 9:17 PM Stefan Hajnoczi wrote: > > On Wed, May 04, 2022 at 03:40:45PM +0800, Xie Yongji wrote: > > Support getting the guest block size for the block backend. > > It's needed for the following commit. > > > > Signed-off-by: Xie Yongji

Re: [PATCH v5 3/8] block/export: Abstract out the logic of virtio-blk I/O process

2022-05-19 Thread Yongji Xie
On Wed, May 18, 2022 at 9:14 PM Stefan Hajnoczi wrote: > > On Wed, May 04, 2022 at 03:40:46PM +0800, Xie Yongji wrote: > > -static void vu_blk_req_complete(VuBlkReq *req) > > +static void vu_blk_req_complete(VuBlkReq *req, size_t in_len) > > { > > VuDev

Re: [PATCH v5 5/8] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-05-19 Thread Yongji Xie
On Wed, May 18, 2022 at 9:46 PM Stefan Hajnoczi wrote: > > On Wed, May 04, 2022 at 03:40:48PM +0800, Xie Yongji wrote: > > +static int vduse_queue_update_vring(VduseVirtq *vq, uint64_t desc_addr, > > +uint64_t avail_addr, uint6

Re: [PATCH v5 8/8] libvduse: Add support for reconnecting

2022-05-19 Thread Yongji Xie
On Wed, May 18, 2022 at 10:03 PM Stefan Hajnoczi wrote: > > On Wed, May 04, 2022 at 03:40:51PM +0800, Xie Yongji wrote: > > @@ -291,6 +294,15 @@ static int vduse_blk_exp_create(BlockExport *exp, > > BlockExportOptions *opts, > > return -ENOMEM; > >

Re: [PATCH v5 8/8] libvduse: Add support for reconnecting

2022-05-19 Thread Yongji Xie
On Thu, May 19, 2022 at 5:44 PM Stefan Hajnoczi wrote: > > On Thu, May 19, 2022 at 04:25:13PM +0800, Yongji Xie wrote: > > On Wed, May 18, 2022 at 10:03 PM Stefan Hajnoczi > > wrote: > > > > > > On Wed, May 04, 2022 at 03:40:51PM +0800, Xie Yongji wrote: >

[PATCH v2 2/6] linux-headers: Add vduse.h

2022-02-15 Thread Xie Yongji
This adds vduse header to linux headers so that the relevant VDUSE API can be used in subsequent patches. Signed-off-by: Xie Yongji --- linux-headers/linux/vduse.h | 306 scripts/update-linux-headers.sh | 2 +- 2 files changed, 307 insertions(+), 1

[PATCH v2 1/6] block: Support passing NULL ops to blk_set_dev_ops()

2022-02-15 Thread Xie Yongji
This supports passing NULL ops to blk_set_dev_ops() so that we can remove stale ops in some cases. Signed-off-by: Xie Yongji --- block/block-backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/block-backend.c b/block/block-backend.c index 4ff6b4d785..08dd0a3093

[PATCH v2 0/6] Support exporting BDSs via VDUSE

2022-02-15 Thread Xie Yongji
irtio-blk config space [Stefan] - Add a patch to support reset blk->dev_ops - Validate vq->log->inflight fields [Stefan] - Add vduse_set_reconnect_log_file() API to support specifing the reconnect log file - Fix some bugs [Stefan] Xie Yongji (6): block: Support passing NULL ops to b

[PATCH v2 5/6] vduse-blk: Add vduse-blk resize support

2022-02-15 Thread Xie Yongji
To support block resize, this uses vduse_dev_update_config() to update the capacity field in configuration space and inject config interrupt on the block resize callback. Signed-off-by: Xie Yongji --- block/export/vduse-blk.c | 20 1 file changed, 20 insertions(+) diff

[PATCH v2 3/6] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-02-15 Thread Xie Yongji
VDUSE [1] is a linux framework that makes it possible to implement software-emulated vDPA devices in userspace. This adds a library as a subproject to help implementing VDUSE backends in QEMU. [1] https://www.kernel.org/doc/html/latest/userspace-api/vduse.html Signed-off-by: Xie Yongji

[PATCH v2 6/6] libvduse: Add support for reconnecting

2022-02-15 Thread Xie Yongji
To support reconnecting after restart or crash, VDUSE backend might need to resubmit inflight I/Os. This stores the metadata such as the index of inflight I/O's descriptors to a shm file so that VDUSE backend can restore them during reconnecting. Signed-off-by: Xie Yongji --- block/export/

[PATCH v2 4/6] vduse-blk: implements vduse-blk export

2022-02-15 Thread Xie Yongji
emon. Signed-off-by: Xie Yongji --- block/export/export.c | 6 + block/export/meson.build | 5 + block/export/vduse-blk.c | 428 ++ block/export/vduse-blk.h | 20 ++ meson.build | 13 ++ meson_options.txt

Re: [PATCH v4 4/6] vduse-blk: implements vduse-blk export

2022-04-27 Thread Yongji Xie
On Wed, Apr 27, 2022 at 9:22 PM Kevin Wolf wrote: > > Am 27.04.2022 um 05:11 hat Yongji Xie geschrieben: > > On Wed, Apr 27, 2022 at 1:03 AM Kevin Wolf wrote: > > > > > > Am 06.04.2022 um 09:59 hat Xie Yongji geschrieben: > > > > This implements a

[PATCH v5 1/8] block: Support passing NULL ops to blk_set_dev_ops()

2022-05-04 Thread Xie Yongji
This supports passing NULL ops to blk_set_dev_ops() so that we can remove stale ops in some cases. Signed-off-by: Xie Yongji --- block/block-backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/block-backend.c b/block/block-backend.c index e0e1aff4b1..35457a6a1d

[PATCH v5 2/8] block-backend: Introduce blk_get_guest_block_size()

2022-05-04 Thread Xie Yongji
Support getting the guest block size for the block backend. It's needed for the following commit. Signed-off-by: Xie Yongji --- block/block-backend.c | 6 ++ include/sysemu/block-backend-io.h | 1 + 2 files changed, 7 insertions(+) diff --git a/block/block-backend.c b/

[PATCH v5 7/8] vduse-blk: Add vduse-blk resize support

2022-05-04 Thread Xie Yongji
To support block resize, this uses vduse_dev_update_config() to update the capacity field in configuration space and inject config interrupt on the block resize callback. Signed-off-by: Xie Yongji Reviewed-by: Stefan Hajnoczi --- block/export/vduse-blk.c | 20 1 file

[PATCH v5 3/8] block/export: Abstract out the logic of virtio-blk I/O process

2022-05-04 Thread Xie Yongji
Abstract the common logic of virtio-blk I/O process to a function named virtio_blk_process_req(). It's needed for the following commit. Signed-off-by: Xie Yongji --- MAINTAINERS | 2 + block/export/meson.build | 2 +- block/export/vhost-user-blk-ser

[PATCH v5 0/8] Support exporting BDSs via VDUSE

2022-05-04 Thread Xie Yongji
[Stefan] - Add vduse_set_reconnect_log_file() API to support specifing the reconnect log file - Fix some bugs [Stefan] Xie Yongji (8): block: Support passing NULL ops to blk_set_dev_ops() block-backend: Introduce blk_get_guest_block_size() block/export: Abstract out the logic of virtio-blk I/O p

[PATCH v5 4/8] linux-headers: Add vduse.h

2022-05-04 Thread Xie Yongji
This adds vduse header to linux headers so that the relevant VDUSE API can be used in subsequent patches. Signed-off-by: Xie Yongji --- linux-headers/linux/vduse.h | 306 scripts/update-linux-headers.sh | 2 +- 2 files changed, 307 insertions(+), 1

[PATCH v5 6/8] vduse-blk: Implement vduse-blk export

2022-05-04 Thread Xie Yongji
emon. Signed-off-by: Xie Yongji --- MAINTAINERS | 4 +- block/export/export.c | 6 + block/export/meson.build | 5 + block/export/vduse-blk.c | 312 ++ block/export/vduse-blk.h | 20 +++ meson.build

[PATCH v5 5/8] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-05-04 Thread Xie Yongji
VDUSE [1] is a linux framework that makes it possible to implement software-emulated vDPA devices in userspace. This adds a library as a subproject to help implementing VDUSE backends in QEMU. [1] https://www.kernel.org/doc/html/latest/userspace-api/vduse.html Signed-off-by: Xie Yongji

[PATCH v5 8/8] libvduse: Add support for reconnecting

2022-05-04 Thread Xie Yongji
To support reconnecting after restart or crash, VDUSE backend might need to resubmit inflight I/Os. This stores the metadata such as the index of inflight I/O's descriptors to a shm file so that VDUSE backend can restore them during reconnecting. Signed-off-by: Xie Yongji --- block/export/

Re: [PATCH-for-7.2 v2] libvduse: Avoid warning about dangerous use of strncpy()

2022-11-11 Thread Yongji Xie
s being treated as errors > ninja: build stopped: cannot make progress due to previous errors. > > Fixes: d9cf16c0be ("libvduse: Replace strcpy() with strncpy()") > Suggested-by: Markus Armbruster > Signed-off-by: Philippe Mathieu-Daudé > --- > Supersedes

Re: Issue with VDUSE (QSD vduse-blk export) and vhost-vdpa

2022-10-26 Thread Yongji Xie
Hi Stefano, On Wed, Oct 26, 2022 at 5:12 PM Stefano Garzarella wrote: > > Hi Xie, > I was testing libblkio [1] with QSD vduse-blk export and had some > issues. > > In a nutshell, QSD prints me the following messages when using > vhost-vdpa to access the device: > >

[PATCH 1/5] libvduse: Fix resources leak in vduse_dev_destroy()

2022-06-13 Thread Xie Yongji
This fixes resource leak when the fd is zero in vduse_dev_destroy(). Fixes: 8dbd281c1675 ("libvduse: Add VDUSE (vDPA Device in Userspace) library") Signed-off-by: Xie Yongji --- subprojects/libvduse/libvduse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/s

[PATCH 2/5] vduse-blk: Don't unlink the reconnect file if device exists

2022-06-13 Thread Xie Yongji
We should not unlink the reconnect file if vduse_dev_destroy() fails with -EBUSY which means the VDUSE device has not been removed from the vDPA bus. Otherwise, we might fail on the reconnection later. Fixes: 730abef0e873 ("libvduse: Add support for reconnecting") Signed-off-by:

[PATCH 5/5] vduse-blk: Add name option

2022-06-13 Thread Xie Yongji
vduse-blk export instead. Signed-off-by: Xie Yongji --- block/export/vduse-blk.c | 4 ++-- docs/tools/qemu-storage-daemon.rst | 5 +++-- qapi/block-export.json | 7 --- storage-daemon/qemu-storage-daemon.c | 8 4 files changed, 13 insertions(+), 11 deletio

[PATCH 0/5] Some fixes and improvements for vduse-blk

2022-06-13 Thread Xie Yongji
This series includes few fixes and improvements for the vduse-blk export. Patch 1 fixes resources leak when vduse fd is zero. Patch 2, 3 fixes two bugs which could be triggered by force deleting a vduse-blk export with high I/O loads. Patch 4, 5 adds two new options for vduse-blk export. Xie

[PATCH 4/5] vduse-blk: Add serial option

2022-06-13 Thread Xie Yongji
Add a 'serial' option to allow user to specify this value explicitly. And the default value is changed to an empty string as what we did in "hw/block/virtio-blk.c". Signed-off-by: Xie Yongji --- block/export/vduse-blk.c | 20 ++-- block/export/vho

[PATCH 3/5] vduse-blk: Don't delete the export until all inflight I/Os completed

2022-06-13 Thread Xie Yongji
Don't delete the export until all inflight I/Os completed. Otherwise, it might lead to a use-after-free. Fixes: cc241b5505b2 ("vduse-blk: Implement vduse-blk export") Signed-off-by: Xie Yongji --- block/export/vduse-blk.c | 22 ++ 1 file changed, 22 insertions

[PATCH v2 2/6] libvduse: Fix resources leak in vduse_dev_destroy()

2022-06-13 Thread Xie Yongji
This fixes resource leak when the fd is zero in vduse_dev_destroy(). Fixes: 8dbd281c1675 ("libvduse: Add VDUSE (vDPA Device in Userspace) library") Signed-off-by: Xie Yongji --- subprojects/libvduse/libvduse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/s

[PATCH v2 3/6] vduse-blk: Don't unlink the reconnect file if device exists

2022-06-13 Thread Xie Yongji
We should not unlink the reconnect file if vduse_dev_destroy() fails with -EBUSY which means the VDUSE device has not been removed from the vDPA bus. Otherwise, we might fail on the reconnection later. Fixes: 730abef0e873 ("libvduse: Add support for reconnecting") Signed-off-by:

[PATCH v2 0/6] Some fixes and improvements for vduse-blk

2022-06-13 Thread Xie Yongji
loads. Patch 5, 6 adds two new options for vduse-blk export. V1 to V2: - Add a patch to fix some compile errors with clang Xie Yongji (6): libvduse: Fix some compile errors with clang libvduse: Fix resources leak in vduse_dev_destroy() vduse-blk: Don't unlink the reconnect file if d

[PATCH v2 5/6] vduse-blk: Add serial option

2022-06-13 Thread Xie Yongji
Add a 'serial' option to allow user to specify this value explicitly. And the default value is changed to an empty string as what we did in "hw/block/virtio-blk.c". Signed-off-by: Xie Yongji --- block/export/vduse-blk.c | 20 ++-- block/export/vho

[PATCH v2 4/6] vduse-blk: Don't delete the export until all inflight I/Os completed

2022-06-13 Thread Xie Yongji
Don't delete the export until all inflight I/Os completed. Otherwise, it might lead to a use-after-free. Fixes: cc241b5505b2 ("vduse-blk: Implement vduse-blk export") Signed-off-by: Xie Yongji --- block/export/vduse-blk.c | 22 ++ 1 file changed, 22 insertions

[PATCH v2 1/6] libvduse: Fix some compile errors with clang

2022-06-13 Thread Xie Yongji
| | long unsigned int |%llu 1319 | version, strerror(errno)); | ~~~ | | | uint64_t

[PATCH v2 6/6] vduse-blk: Add name option

2022-06-13 Thread Xie Yongji
vduse-blk export instead. Signed-off-by: Xie Yongji --- block/export/vduse-blk.c | 4 ++-- docs/tools/qemu-storage-daemon.rst | 5 +++-- qapi/block-export.json | 7 --- storage-daemon/qemu-storage-daemon.c | 8 4 files changed, 13 insertions(+), 11 deletio

Re: Re: [PULL 00/18] Block layer patches

2022-06-13 Thread Yongji Xie
On Tue, Jun 14, 2022 at 1:04 AM Kevin Wolf wrote: > > Am 09.06.2022 um 22:18 hat Richard Henderson geschrieben: > > On 6/9/22 10:21, Kevin Wolf wrote: > > > The following changes since commit > > > 028f2361d0c2d28d6f918fe618f389228ac22b60: > > > > > >Merge tag 'pull-target-arm-20220609' of >

Re: [PATCH v2 09/10] libvduse: Switch to unsigned int for inuse field in struct VduseVirtq

2022-12-21 Thread Yongji Xie
nsigned int in the fist place. > > Signed-off-by: Marcel Holtmann > --- > subprojects/libvduse/libvduse.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Reviewed-by: Xie Yongji Thanks, Yongji

Re: [RFC v2 10/10] libvduse: Fix assignment in vring_set_avail_event

2022-12-21 Thread Yongji Xie
On Wed, Dec 21, 2022 at 3:27 AM Marcel Holtmann wrote: > > CC libvduse.o > libvduse.c: In function ‘vring_set_avail_event’: > libvduse.c:603:7: error: dereferencing type-punned pointer will break > strict-aliasing rules [-Werror=strict-aliasin] > 603 | *((uint16_t *)&vq->vring.used-

Re: [PATCH v2 3/6] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-03-15 Thread Yongji Xie
On Tue, Mar 15, 2022 at 5:48 PM Stefan Hajnoczi wrote: > > On Tue, Feb 15, 2022 at 06:59:40PM +0800, Xie Yongji wrote: > > VDUSE [1] is a linux framework that makes it possible to implement > > software-emulated vDPA devices in userspace. This adds a library > >

Re: [PATCH v2 4/6] vduse-blk: implements vduse-blk export

2022-03-15 Thread Yongji Xie
On Tue, Mar 15, 2022 at 7:08 PM Stefan Hajnoczi wrote: > > On Tue, Feb 15, 2022 at 06:59:41PM +0800, Xie Yongji wrote: > > This implements a VDUSE block backends based on > > the libvduse library. We can use it to export the BDSs > > for both VM and container (host) usage.

Re: [PATCH v2 6/6] libvduse: Add support for reconnecting

2022-03-15 Thread Yongji Xie
On Tue, Mar 15, 2022 at 9:48 PM Stefan Hajnoczi wrote: > > On Tue, Feb 15, 2022 at 06:59:43PM +0800, Xie Yongji wrote: > > +static int vduse_queue_inflight_get(VduseVirtq *vq, int desc_idx) > > +{ > > +vq->log->inflight.desc[desc_idx].counter = vq->counter++

[PATCH v2 0/3] Fix some coverity issues on VDUSE

2022-07-06 Thread Xie Yongji
x27;t use g_strlcpy() [Markus] Xie Yongji (3): libvduse: Fix the incorrect function name libvduse: Replace strcpy() with strncpy() libvduse: Pass positive value to strerror() subprojects/libvduse/libvduse.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) -- 2.20.1

[PATCH v2 1/3] libvduse: Fix the incorrect function name

2022-07-06 Thread Xie Yongji
In vduse_name_is_valid(), we actually check whether the name is invalid or not. So let's change the function name to vduse_name_is_invalid() to match the behavior. Signed-off-by: Xie Yongji Reviewed-by: Markus Armbruster --- subprojects/libvduse/libvduse.c | 6 +++--- 1 file chang

[PATCH v2 2/3] libvduse: Replace strcpy() with strncpy()

2022-07-06 Thread Xie Yongji
) with strncpy() (as a general library, we'd like to minimize dependencies on other libraries, so we didn't use g_strlcpy() here) to fix the coverity complaint. Fixes: Coverity CID 1490224 Signed-off-by: Xie Yongji Reviewed-by: Markus Armbruster --- subprojects/libvduse/libvduse.c | 3

[PATCH v2 3/3] libvduse: Pass positive value to strerror()

2022-07-06 Thread Xie Yongji
The value passed to strerror() should be positive. So let's fix it. Fixes: Coverity CID 1490226, 1490223 Signed-off-by: Xie Yongji Reviewed-by: Richard Henderson Reviewed-by: Markus Armbruster --- subprojects/libvduse/libvduse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v6 1/8] block: Support passing NULL ops to blk_set_dev_ops()

2022-05-23 Thread Xie Yongji
This supports passing NULL ops to blk_set_dev_ops() so that we can remove stale ops in some cases. Signed-off-by: Xie Yongji Reviewed-by: Stefan Hajnoczi --- block/block-backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/block-backend.c b/block/block-backend.c

[PATCH v6 0/8] Support exporting BDSs via VDUSE

2022-05-23 Thread Xie Yongji
- Increase default queue size to 256 for vduse-blk [Stefan] - Zero-initialize virtio-blk config space [Stefan] - Add a patch to support reset blk->dev_ops - Validate vq->log->inflight fields [Stefan] - Add vduse_set_reconnect_log_file() API to support specifing the reconnect log file - Fix some

[PATCH v6 4/8] linux-headers: Add vduse.h

2022-05-23 Thread Xie Yongji
This adds vduse header to linux headers so that the relevant VDUSE API can be used in subsequent patches. Signed-off-by: Xie Yongji Reviewed-by: Stefan Hajnoczi --- linux-headers/linux/vduse.h | 306 scripts/update-linux-headers.sh | 2 +- 2 files changed

[PATCH v6 6/8] vduse-blk: Implement vduse-blk export

2022-05-23 Thread Xie Yongji
emon. Signed-off-by: Xie Yongji Reviewed-by: Stefan Hajnoczi --- MAINTAINERS | 4 +- block/export/export.c | 6 + block/export/meson.build | 5 + block/export/vduse-blk.c | 307 ++ block/export/vduse-blk.h |

[PATCH v6 8/8] libvduse: Add support for reconnecting

2022-05-23 Thread Xie Yongji
To support reconnecting after restart or crash, VDUSE backend might need to resubmit inflight I/Os. This stores the metadata such as the index of inflight I/O's descriptors to a shm file so that VDUSE backend can restore them during reconnecting. Signed-off-by: Xie Yongji --- block/export/

[PATCH v6 3/8] block/export: Abstract out the logic of virtio-blk I/O process

2022-05-23 Thread Xie Yongji
Abstract the common logic of virtio-blk I/O process to a function named virtio_blk_process_req(). It's needed for the following commit. Signed-off-by: Xie Yongji --- MAINTAINERS | 2 + block/export/meson.build | 2 +- block/export/vhost-user-blk-ser

[PATCH v6 2/8] block/export: Fix incorrect length passed to vu_queue_push()

2022-05-23 Thread Xie Yongji
Now the req->size is set to the correct value only when handling VIRTIO_BLK_T_GET_ID request. This patch fixes it. Signed-off-by: Xie Yongji --- block/export/vhost-user-blk-server.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/block/export/vhost-user-blk-server.c

[PATCH v6 5/8] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-05-23 Thread Xie Yongji
VDUSE [1] is a linux framework that makes it possible to implement software-emulated vDPA devices in userspace. This adds a library as a subproject to help implementing VDUSE backends in QEMU. [1] https://www.kernel.org/doc/html/latest/userspace-api/vduse.html Signed-off-by: Xie Yongji

[PATCH v6 7/8] vduse-blk: Add vduse-blk resize support

2022-05-23 Thread Xie Yongji
To support block resize, this uses vduse_dev_update_config() to update the capacity field in configuration space and inject config interrupt on the block resize callback. Signed-off-by: Xie Yongji Reviewed-by: Stefan Hajnoczi --- block/export/vduse-blk.c | 20 1 file

Re: [PATCH v6 0/8] Support exporting BDSs via VDUSE

2022-05-25 Thread Yongji Xie
On Wed, May 25, 2022 at 8:48 PM Stefan Hajnoczi wrote: > > On Mon, May 23, 2022 at 04:46:03PM +0800, Xie Yongji wrote: > > Hi all, > > > > Last few months ago, VDUSE (vDPA Device in Userspace) [1] has > > been merged into Linux kernel as a framework that make it

Re: [PATCH v6 0/8] Support exporting BDSs via VDUSE

2022-05-25 Thread Yongji Xie
On Wed, May 25, 2022 at 7:02 PM Stefan Hajnoczi wrote: > > On Mon, May 23, 2022 at 04:46:03PM +0800, Xie Yongji wrote: > > Hi all, > > > > Last few months ago, VDUSE (vDPA Device in Userspace) [1] has > > been merged into Linux kernel as a framework that make it

Re: [PATCH] qsd: document vduse-blk exports

2022-05-26 Thread Yongji Xie
On Wed, May 25, 2022 at 8:19 PM Stefan Hajnoczi wrote: > > Document vduse-blk exports in qemu-storage-daemon --help and the > qemu-storage-daemon(1) man page. > > Based-on: <20220523084611.91-1-xieyon...@bytedance.com> > Cc: Xie Yongji > Signed-off-by: Stefan Hajnocz

Re: [PATCH v6 6/8] vduse-blk: Implement vduse-blk export

2022-05-29 Thread Yongji Xie
On Fri, May 27, 2022 at 11:34 PM Kevin Wolf wrote: > > Am 23.05.2022 um 10:46 hat Xie Yongji geschrieben: > > This implements a VDUSE block backends based on > > the libvduse library. We can use it to export the BDSs > > for both VM and container (host) usage. > > &

[PATCH] vduse-blk: Add name option

2022-05-30 Thread Xie Yongji
vduse-blk export instead. Signed-off-by: Xie Yongji --- block/export/vduse-blk.c | 6 +++--- docs/tools/qemu-storage-daemon.rst | 5 +++-- qapi/block-export.json | 7 --- storage-daemon/qemu-storage-daemon.c | 8 4 files changed, 14 insertions(+), 12 d

[PATCH v2] vduse-blk: Add name option

2022-05-31 Thread Xie Yongji
vduse-blk export instead. Signed-off-by: Xie Yongji --- block/export/vduse-blk.c | 9 ++--- docs/tools/qemu-storage-daemon.rst | 5 +++-- qapi/block-export.json | 7 --- storage-daemon/qemu-storage-daemon.c | 8 4 files changed, 17 insertions(+), 12 d

Re: [PATCH v2] vduse-blk: Add name option

2022-06-01 Thread Yongji Xie
On Wed, Jun 1, 2022 at 9:03 PM Stefan Hajnoczi wrote: > > On Tue, May 31, 2022 at 05:52:21PM +0800, Xie Yongji wrote: > > Currently we use 'id' option as the name of VDUSE device. > > It's a bit confusing since we use one value for two different > > purpos

Re: [PATCH v2] vduse-blk: Add name option

2022-06-06 Thread Yongji Xie
On Mon, Jun 6, 2022 at 7:05 PM Stefan Hajnoczi wrote: > > On Wed, Jun 01, 2022 at 09:10:58PM +0800, Yongji Xie wrote: > > On Wed, Jun 1, 2022 at 9:03 PM Stefan Hajnoczi wrote: > > > > > > On Tue, May 31, 2022 at 05:52:21PM +0800, Xie Yongji wrote: > > > >

Re: [PATCH v6 5/8] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-06-06 Thread Yongji Xie
On Fri, Jun 3, 2022 at 7:25 PM Maxime Coquelin wrote: > > Hi Yongji, > > On 5/23/22 10:46, Xie Yongji wrote: > > VDUSE [1] is a linux framework that makes it possible to implement > > software-emulated vDPA devices in userspace. This adds a library > > as a subproj

Re: [PATCH v2 4/6] vduse-blk: implements vduse-blk export

2022-03-16 Thread Yongji Xie
On Wed, Mar 16, 2022 at 8:16 PM Stefan Hajnoczi wrote: > > On Tue, Mar 15, 2022 at 07:52:03PM +0800, Yongji Xie wrote: > > On Tue, Mar 15, 2022 at 7:08 PM Stefan Hajnoczi wrote: > > > > > > On Tue, Feb 15, 2022 at 06:59:41PM +0800, Xie Yongji wrote: > > > &

Re: [PATCH v2 3/6] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-03-16 Thread Yongji Xie
On Wed, Mar 16, 2022 at 9:28 PM Stefan Hajnoczi wrote: > > On Tue, Mar 15, 2022 at 07:38:12PM +0800, Yongji Xie wrote: > > On Tue, Mar 15, 2022 at 5:48 PM Stefan Hajnoczi wrote: > > > > > > On Tue, Feb 15, 2022 at 06:59:40PM +0800, Xie Yongji wrote: > > >

Re: [PATCH v2 3/6] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-03-16 Thread Yongji Xie
On Wed, Mar 16, 2022 at 11:51 PM Stefan Hajnoczi wrote: > > On Wed, Mar 16, 2022 at 09:49:19PM +0800, Yongji Xie wrote: > > On Wed, Mar 16, 2022 at 9:28 PM Stefan Hajnoczi wrote: > > > > > > On Tue, Mar 15, 2022 at 07:38:12PM +0800, Yongji Xie wrote: > >

[PATCH v3 0/6] Support exporting BDSs via VDUSE

2022-03-21 Thread Xie Yongji
g->inflight fields [Stefan] - Add vduse_set_reconnect_log_file() API to support specifing the reconnect log file - Fix some bugs [Stefan] Xie Yongji (6): block: Support passing NULL ops to blk_set_dev_ops() linux-headers: Add vduse.h libvduse: Add VDUSE (vDPA Device in Userspace) libra

[PATCH v3 2/6] linux-headers: Add vduse.h

2022-03-21 Thread Xie Yongji
This adds vduse header to linux headers so that the relevant VDUSE API can be used in subsequent patches. Signed-off-by: Xie Yongji --- linux-headers/linux/vduse.h | 306 scripts/update-linux-headers.sh | 2 +- 2 files changed, 307 insertions(+), 1

[PATCH v3 3/6] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-03-21 Thread Xie Yongji
VDUSE [1] is a linux framework that makes it possible to implement software-emulated vDPA devices in userspace. This adds a library as a subproject to help implementing VDUSE backends in QEMU. [1] https://www.kernel.org/doc/html/latest/userspace-api/vduse.html Signed-off-by: Xie Yongji

[PATCH v3 1/6] block: Support passing NULL ops to blk_set_dev_ops()

2022-03-21 Thread Xie Yongji
This supports passing NULL ops to blk_set_dev_ops() so that we can remove stale ops in some cases. Signed-off-by: Xie Yongji --- block/block-backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/block-backend.c b/block/block-backend.c index e0e1aff4b1..35457a6a1d

[PATCH v3 6/6] libvduse: Add support for reconnecting

2022-03-21 Thread Xie Yongji
To support reconnecting after restart or crash, VDUSE backend might need to resubmit inflight I/Os. This stores the metadata such as the index of inflight I/O's descriptors to a shm file so that VDUSE backend can restore them during reconnecting. Signed-off-by: Xie Yongji --- block/export/

[PATCH v3 5/6] vduse-blk: Add vduse-blk resize support

2022-03-21 Thread Xie Yongji
To support block resize, this uses vduse_dev_update_config() to update the capacity field in configuration space and inject config interrupt on the block resize callback. Signed-off-by: Xie Yongji Reviewed-by: Stefan Hajnoczi --- block/export/vduse-blk.c | 20 1 file

[PATCH v3 4/6] vduse-blk: implements vduse-blk export

2022-03-21 Thread Xie Yongji
emon. Signed-off-by: Xie Yongji --- MAINTAINERS | 4 +- block/export/export.c | 6 + block/export/meson.build | 5 + block/export/vduse-blk.c | 425 ++ block/export/vduse-blk.h | 20 ++ meson.build

Re: [PATCH v3 4/6] vduse-blk: implements vduse-blk export

2022-03-21 Thread Yongji Xie
On Mon, Mar 21, 2022 at 9:25 PM Eric Blake wrote: > > On Mon, Mar 21, 2022 at 03:14:37PM +0800, Xie Yongji wrote: > > This implements a VDUSE block backends based on > > the libvduse library. We can use it to export the BDSs > > for both VM and container (host) usage. >

[PATCH v4 0/6] Support exporting BDSs via VDUSE

2022-04-06 Thread Xie Yongji
pport reset blk->dev_ops - Validate vq->log->inflight fields [Stefan] - Add vduse_set_reconnect_log_file() API to support specifing the reconnect log file - Fix some bugs [Stefan] Xie Yongji (6): block: Support passing NULL ops to blk_set_dev_ops() linux-headers: Add vduse.h libvd

[PATCH v4 2/6] linux-headers: Add vduse.h

2022-04-06 Thread Xie Yongji
This adds vduse header to linux headers so that the relevant VDUSE API can be used in subsequent patches. Signed-off-by: Xie Yongji --- linux-headers/linux/vduse.h | 306 scripts/update-linux-headers.sh | 2 +- 2 files changed, 307 insertions(+), 1

[PATCH v4 3/6] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-04-06 Thread Xie Yongji
VDUSE [1] is a linux framework that makes it possible to implement software-emulated vDPA devices in userspace. This adds a library as a subproject to help implementing VDUSE backends in QEMU. [1] https://www.kernel.org/doc/html/latest/userspace-api/vduse.html Signed-off-by: Xie Yongji

<    1   2   3   4   5   6   7   >