summaryrefslogtreecommitdiffstats
path: root/subprojects/libvduse
Commit message (Collapse)AuthorAgeFilesLines
* libvduse: Pass positive value to strerror()Xie Yongji2022-08-021-2/+2
| | | | | | | | | | | | The value passed to strerror() should be positive. So let's fix it. Fixes: Coverity CID 1490226, 1490223 Signed-off-by: Xie Yongji <xieyongji@bytedance.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20220706095624.328-4-xieyongji@bytedance.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* libvduse: Replace strcpy() with strncpy()Xie Yongji2022-08-021-1/+2
| | | | | | | | | | | | | | | | Coverity reported a string overflow issue since we copied "name" to "dev_config->name" without checking the length. This should be a false positive since we already checked the length of "name" in vduse_name_is_invalid(). But anyway, let's replace strcpy() 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 <xieyongji@bytedance.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20220706095624.328-3-xieyongji@bytedance.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* libvduse: Fix the incorrect function nameXie Yongji2022-08-021-3/+3
| | | | | | | | | | | | 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 <xieyongji@bytedance.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20220706095624.328-2-xieyongji@bytedance.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* libvduse: Add support for reconnectingXie Yongji2022-06-242-5/+242
| | | | | | | | | | | | 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 <xieyongji@bytedance.com> Message-Id: <20220523084611.91-9-xieyongji@bytedance.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* libvduse: Add VDUSE (vDPA Device in Userspace) libraryXie Yongji2022-06-247-0/+1399
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 <xieyongji@bytedance.com> Message-Id: <20220523084611.91-6-xieyongji@bytedance.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>