diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2015-10-09 17:17:20 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-10-22 14:34:48 +0300 |
commit | d3592199ba3db504c6585115b9531b4cf7c50a0d (patch) | |
tree | 4f89aba61735a1df874795eb8611462b2bb86f77 /include | |
parent | f04cf9239addd12d6be9e7ff137262755e3680d3 (diff) | |
download | qemu-d3592199ba3db504c6585115b9531b4cf7c50a0d.zip qemu-d3592199ba3db504c6585115b9531b4cf7c50a0d.tar.gz qemu-d3592199ba3db504c6585115b9531b4cf7c50a0d.tar.bz2 |
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')
-rw-r--r-- | include/qemu/memfd.h | 4 |
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 */ |