On Fri, Jun 3, 2022 at 7:25 PM Maxime Coquelin <maxime.coque...@redhat.com> 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 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 <xieyon...@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) { >
OK. > > + close(dev->fd); > > + dev->fd = -1; > > + } > > + if (dev->ctrl_fd > 0) { > > if (dev->ctrl_fd >= 0) { > Thanks for the review. I will fix them. Thanks, Yongji