util/oslib: Have qemu_prealloc_mem() handler return a boolean

Following the example documented since commit e3fe3988d7 ("error:
Document Error API usage rules"), have qemu_prealloc_mem()
return a boolean indicating whether an error is set or not.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Message-Id: <20231120213301.24349-19-philmd@linaro.org>
This commit is contained in:
Philippe Mathieu-Daudé 2023-11-20 15:33:19 +01:00
parent 3961613a76
commit b622ee98bf
3 changed files with 11 additions and 4 deletions

View file

@ -678,8 +678,10 @@ typedef struct ThreadContext ThreadContext;
* memory area starting at @area with the size of @sz. After a successful call,
* each page in the area was faulted in writable at least once, for example,
* after allocating file blocks for mapped files.
*
* Return: true on success, else false setting @errp with error.
*/
void qemu_prealloc_mem(int fd, char *area, size_t sz, int max_threads,
bool qemu_prealloc_mem(int fd, char *area, size_t sz, int max_threads,
ThreadContext *tc, Error **errp);
/**