summaryrefslogtreecommitdiffstats
path: root/include/qemu
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2015-10-09 17:17:20 +0200
committerMichael S. Tsirkin <mst@redhat.com>2015-10-22 14:34:48 +0300
commitd3592199ba3db504c6585115b9531b4cf7c50a0d (patch)
tree4f89aba61735a1df874795eb8611462b2bb86f77 /include/qemu
parentf04cf9239addd12d6be9e7ff137262755e3680d3 (diff)
downloadhqemu-d3592199ba3db504c6585115b9531b4cf7c50a0d.zip
hqemu-d3592199ba3db504c6585115b9531b4cf7c50a0d.tar.gz
util: add memfd helpers
Add qemu_memfd_alloc/free() helpers. The function helps to allocate and seal shared memory. 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>
Diffstat (limited to 'include/qemu')
-rw-r--r--include/qemu/memfd.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/qemu/memfd.h b/include/qemu/memfd.h
index 8b1fe6a..950fb88 100644
--- a/include/qemu/memfd.h
+++ b/include/qemu/memfd.h
@@ -17,4 +17,8 @@
#define F_SEAL_WRITE 0x0008 /* prevent writes */
#endif
+void *qemu_memfd_alloc(const char *name, size_t size, unsigned int seals,
+ int *fd);
+void qemu_memfd_free(void *ptr, size_t size, int fd);
+
#endif /* QEMU_MEMFD_H */
OpenPOWER on IntegriCloud