util: add fallback for qemu_memfd_alloc()
commit35f9b6ef3acc9d0546c395a566b04e63ca84e302
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 9 Oct 2015 15:17:21 +0000 (9 17:17 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 22 Oct 2015 11:34:49 +0000 (22 14:34 +0300)
tree60c61e946a41bca2bca032ee1481c2933aad364c
parentd3592199ba3db504c6585115b9531b4cf7c50a0d
util: add fallback for qemu_memfd_alloc()

Add an open/unlink/mmap fallback for system that do not support
memfd (only available since 3.17, ~1y ago).

This patch may require additional SELinux policies to work for enforced
systems, but should fail gracefully in this case.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Thibaut Collet <thibaut.collet@6wind.com>
util/memfd.c