memfd: add error argument, instead of perror()

This will allow callers to silence error report when the call is
allowed to failed.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20180201132757.23063-2-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Marc-André Lureau 2018-02-01 14:27:51 +01:00 committed by Paolo Bonzini
parent dbadee4ff4
commit 0f2956f915
3 changed files with 40 additions and 30 deletions

View file

@ -16,9 +16,10 @@
#define F_SEAL_WRITE 0x0008 /* prevent writes */
#endif
int qemu_memfd_create(const char *name, size_t size, unsigned int seals);
int qemu_memfd_create(const char *name, size_t size, unsigned int seals,
Error **errp);
void *qemu_memfd_alloc(const char *name, size_t size, unsigned int seals,
int *fd);
int *fd, Error **errp);
void qemu_memfd_free(void *ptr, size_t size, int fd);
bool qemu_memfd_check(void);