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
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
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
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
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
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
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
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
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
.
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
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(+)
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
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
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:
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
long unsigned int
|%llu
1319 | version, strerror(errno));
| ~~~
| |
| uint64_t {aka long long unsigned int}
Signed-off-by: Xie Yongji
---
subproj
.
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
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(+)
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:
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
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
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
.
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
.
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
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
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
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
-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 |
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
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
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
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
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
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
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
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
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
-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
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
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
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
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
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
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:
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
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
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
-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
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
-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
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
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
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
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
;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
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
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
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
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
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
-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
-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
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
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
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
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
-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
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
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
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
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
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
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
73 matches
Mail list logo