mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
backends: Have HostMemoryBackendClass::alloc() handler return a boolean
Following the example documented since commit e3fe3988d7
("error:
Document Error API usage rules"), have HostMemoryBackendClass::alloc
return a boolean indicating whether an error is set or not.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Message-Id: <20231120213301.24349-17-philmd@linaro.org>
This commit is contained in:
parent
e199f7ad4d
commit
fdb63cf3b5
6 changed files with 36 additions and 28 deletions
|
@ -47,7 +47,15 @@ OBJECT_DECLARE_TYPE(HostMemoryBackend, HostMemoryBackendClass,
|
|||
struct HostMemoryBackendClass {
|
||||
ObjectClass parent_class;
|
||||
|
||||
void (*alloc)(HostMemoryBackend *backend, Error **errp);
|
||||
/**
|
||||
* alloc: Allocate memory from backend.
|
||||
*
|
||||
* @backend: the #HostMemoryBackend.
|
||||
* @errp: pointer to Error*, to store an error if it happens.
|
||||
*
|
||||
* Return: true on success, else false setting @errp with error.
|
||||
*/
|
||||
bool (*alloc)(HostMemoryBackend *backend, Error **errp);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue