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

@ -264,7 +264,7 @@ int getpagesize(void)
return system_info.dwPageSize;
}
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)
{
int i;
@ -274,6 +274,8 @@ void qemu_prealloc_mem(int fd, char *area, size_t sz, int max_threads,
for (i = 0; i < sz / pagesize; i++) {
memset(area + pagesize * i, 0, 1);
}
return true;
}
char *qemu_get_pid_name(pid_t pid)