mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
fix qemu exit on memory hotplug when allocation fails at prealloc time
When adding hostmem backend at runtime, QEMU might exit with error: "os_mem_prealloc: Insufficient free host memory pages available to allocate guest RAM" It happens due to os_mem_prealloc() not handling errors gracefully. Fix it by passing errp argument so that os_mem_prealloc() could report error to callers and undo performed allocation when os_mem_prealloc() fails. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <1469008443-72059-1-git-send-email-imammedo@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
0b21757124
commit
056b68af77
5 changed files with 38 additions and 22 deletions
|
@ -539,7 +539,7 @@ int getpagesize(void)
|
|||
return system_info.dwPageSize;
|
||||
}
|
||||
|
||||
void os_mem_prealloc(int fd, char *area, size_t memory)
|
||||
void os_mem_prealloc(int fd, char *area, size_t memory, Error **errp)
|
||||
{
|
||||
int i;
|
||||
size_t pagesize = getpagesize();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue