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

2022-07-06 Thread Xie Yongji
h 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 ++- 1 file cha

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

2022-07-06 Thread Xie Yongji
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 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(-) diff

[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 changed, 3

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

2022-06-27 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 --- subprojects/libvduse/libvduse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/libvduse/libvduse.c b/subprojects/libvduse

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

2022-06-27 Thread Xie Yongji
Coverity pointed out (CID 1490222, 1490227) that we called ioctl somewhere without checking the return value. This patch fixes these issues. Fixes: Coverity CID 1490222, 1490227 Signed-off-by: Xie Yongji --- subprojects/libvduse/libvduse.c | 10 -- 1 file changed, 8 insertions(+), 2

[PATCH 0/4] Fix some coverity issues on VDUSE

2022-06-27 Thread Xie Yongji
This series fixes some issues reported by coverity. Patch 1 fixes an incorrect function name. Patch 2 fixes Coverity CID 1490224. Patch 3 fixes Coverity CID 1490226, 1490223. Patch 4 fixes Coverity CID 1490222, 1490227. Xie Yongji (4): libvduse: Fix the incorrect function name libvduse

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

2022-06-27 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 --- subprojects/libvduse/libvduse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

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

2022-06-27 Thread Xie Yongji
ith strncpy() to fix the coverity complaint. Fixes: Coverity CID 1490224 Signed-off-by: Xie Yongji --- subprojects/libvduse/libvduse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subprojects/libvduse/libvduse.c b/subprojects/libvduse/libvduse.c index 6374933881..1e36227388

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

2022-06-13 Thread Xie Yongji
. 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 deletions(-) diff --git a/block

[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 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 device

[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/vhost-user-bl

[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 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 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 {aka long long unsigned int} Signed-off-by: Xie Yongji --- subproj

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

2022-06-13 Thread Xie Yongji
. 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 deletions(-) diff --git a/block

[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 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 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 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/vhost-user-bl

[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 v2] vduse-blk: Add name option

2022-05-31 Thread Xie Yongji
. 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 deletions(-) diff --git

[PATCH] vduse-blk: Add name option

2022-05-30 Thread Xie Yongji
. 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 deletions(-) diff --git

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

2022-05-23 Thread Xie Yongji
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 bugs [Ste

[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/vduse

[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

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

2022-05-23 Thread Xie Yongji
-daemon. 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 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 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 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 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 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-server.c

[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 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 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/vduse

[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-server.c

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

2022-05-04 Thread Xie Yongji
-daemon. 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 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/block

[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 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 0/8] Support exporting BDSs via VDUSE

2022-05-04 Thread Xie Yongji
an] - 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 proces

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

2022-04-06 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 v4 0/6] Support exporting BDSs via VDUSE

2022-04-06 Thread Xie Yongji
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 libvduse:

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

2022-04-06 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/vduse

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

2022-04-06 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 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

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

2022-04-06 Thread Xie Yongji
-daemon. 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

[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 v3 4/6] vduse-blk: implements vduse-blk export

2022-03-21 Thread Xie Yongji
-daemon. 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

[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 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/vduse

[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 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 0/6] Support exporting BDSs via VDUSE

2022-03-21 Thread Xie Yongji
;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) library

[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 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/vduse

[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 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 4/6] vduse-blk: implements vduse-blk export

2022-02-15 Thread Xie Yongji
-daemon. 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

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

2022-02-15 Thread Xie Yongji
-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 blk_se

[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 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

[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 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 3/5] vduse-blk: implements vduse-blk export

2022-01-25 Thread Xie Yongji
-daemon. 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/vduse

[PATCH 0/5] Support exporting BDSs via VDUSE

2022-01-25 Thread Xie Yongji
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 vduse.h

[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 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 1/2] iscsi: handle check condition status in retry loop

2020-07-01 Thread Xie Yongji
The handling of check condition was incorrect because we would only do it after retries exceed maximum. Fixes: 8c460269aa ("iscsi: base all handling of check condition on scsi_sense_to_errno") Signed-off-by: Xie Yongji --- block/iscsi.c | 20 ++-- 1 file changed, 10

[PATCH 2/2] iscsi: return -EIO when sense fields are meaningless

2020-07-01 Thread Xie Yongji
When an I/O request failed, now we only return correct value on scsi check condition. We should also have a default errno such as -EIO in other case. Signed-off-by: Xie Yongji --- block/iscsi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/iscsi.c b/block/iscsi.c index 2964c9f8d2