From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Xie Yongji <xieyongji@bytedance.com>,
mst@redhat.com, jasowang@redhat.com, stefanha@redhat.com,
sgarzare@redhat.com, kwolf@redhat.com, mreitz@redhat.com,
mlureau@redhat.com, jsnow@redhat.com, eblake@redhat.com,
Coiby.Xu@gmail.com, hreitz@redhat.com
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH v6 5/8] libvduse: Add VDUSE (vDPA Device in Userspace) library
Date: Fri, 3 Jun 2022 13:25:13 +0200 [thread overview]
Message-ID: <0fec2667-88ce-7388-086f-2dfc7d6bf9d7@redhat.com> (raw)
In-Reply-To: <20220523084611.91-6-xieyongji@bytedance.com>
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 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>
> ---
> MAINTAINERS | 5 +
> meson.build | 15 +
> meson_options.txt | 2 +
> scripts/meson-buildoptions.sh | 3 +
> subprojects/libvduse/include/atomic.h | 1 +
> subprojects/libvduse/include/compiler.h | 1 +
> subprojects/libvduse/libvduse.c | 1167 +++++++++++++++++++
> subprojects/libvduse/libvduse.h | 235 ++++
> subprojects/libvduse/linux-headers/linux | 1 +
> subprojects/libvduse/meson.build | 10 +
> subprojects/libvduse/standard-headers/linux | 1 +
> 11 files changed, 1441 insertions(+)
> create mode 120000 subprojects/libvduse/include/atomic.h
> create mode 120000 subprojects/libvduse/include/compiler.h
> create mode 100644 subprojects/libvduse/libvduse.c
> create mode 100644 subprojects/libvduse/libvduse.h
> create mode 120000 subprojects/libvduse/linux-headers/linux
> create mode 100644 subprojects/libvduse/meson.build
> create mode 120000 subprojects/libvduse/standard-headers/linux
>
...
> diff --git a/subprojects/libvduse/libvduse.c b/subprojects/libvduse/libvduse.c
> new file mode 100644
> index 0000000000..fa4822b9a9
> --- /dev/null
> +++ b/subprojects/libvduse/libvduse.c
> @@ -0,0 +1,1167 @@
...
> +
> +int vduse_dev_destroy(VduseDev *dev)
> +{
> + int ret = 0;
> +
> + free(dev->vqs);
> + if (dev->fd > 0) {
if (dev->fd >= 0) {
> + close(dev->fd);
> + dev->fd = -1;
> + }
> + if (dev->ctrl_fd > 0) {
if (dev->ctrl_fd >= 0) {
> + if (ioctl(dev->ctrl_fd, VDUSE_DESTROY_DEV, dev->name)) {
> + ret = -errno;
> + }
> + close(dev->ctrl_fd);
> + dev->ctrl_fd = -1;
> + }
> + free(dev->name);
> + free(dev);
> +
> + return ret;
> +}
Maxime
next prev parent reply other threads:[~2022-06-03 11:30 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-23 8:46 [PATCH v6 0/8] Support exporting BDSs via VDUSE Xie Yongji
2022-05-23 8:46 ` [PATCH v6 1/8] block: Support passing NULL ops to blk_set_dev_ops() Xie Yongji
2022-05-23 8:46 ` [PATCH v6 2/8] block/export: Fix incorrect length passed to vu_queue_push() Xie Yongji
2022-05-23 8:46 ` [PATCH v6 3/8] block/export: Abstract out the logic of virtio-blk I/O process Xie Yongji
2022-05-23 8:46 ` [PATCH v6 4/8] linux-headers: Add vduse.h Xie Yongji
2022-05-23 8:46 ` [PATCH v6 5/8] libvduse: Add VDUSE (vDPA Device in Userspace) library Xie Yongji
2022-06-03 11:25 ` Maxime Coquelin [this message]
2022-06-06 12:56 ` Yongji Xie
2022-05-23 8:46 ` [PATCH v6 6/8] vduse-blk: Implement vduse-blk export Xie Yongji
2022-05-27 15:33 ` Kevin Wolf
2022-05-29 8:13 ` Yongji Xie
2022-05-23 8:46 ` [PATCH v6 7/8] vduse-blk: Add vduse-blk resize support Xie Yongji
2022-05-23 8:46 ` [PATCH v6 8/8] libvduse: Add support for reconnecting Xie Yongji
2022-05-25 11:02 ` [PATCH v6 0/8] Support exporting BDSs via VDUSE Stefan Hajnoczi
2022-05-25 12:52 ` Yongji Xie
2022-05-25 12:48 ` Stefan Hajnoczi
2022-05-25 12:51 ` Yongji Xie
2022-05-27 15:48 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0fec2667-88ce-7388-086f-2dfc7d6bf9d7@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=Coiby.Xu@gmail.com \
--cc=eblake@redhat.com \
--cc=hreitz@redhat.com \
--cc=jasowang@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mlureau@redhat.com \
--cc=mreitz@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
--cc=stefanha@redhat.com \
--cc=xieyongji@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).