libvhost-user: replace qemu/memfd.h usage
commit810033be083040591fee2fc09f2f294670ed1930
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 25 Nov 2020 10:06:34 +0000 (25 14:06 +0400)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 8 Dec 2020 18:48:58 +0000 (8 13:48 -0500)
treedc3a1ae81b3e92fa3ee436958893a6ca44f62fea
parent0ca293155b7bada98afdb250b74577fd5895f0bb
libvhost-user: replace qemu/memfd.h usage

Undo the damage from commit 5f9ff1eff3 ("libvhost-user: Support tracking
inflight I/O in shared memory") which introduced glib dependency through
osdep.h inclusion.

libvhost-user.c tries to stay free from glib usage.

Use glibc memfd_create directly when available (assumed so when
MFD_ALLOW_SEALING is defined). A following commit will make the project
standalone and check for memfd API at configure time, instead of a
panic at runtime.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20201125100640.366523-3-marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
contrib/libvhost-user/libvhost-user.c