mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
xen-hvm: Clean up xen_ram_alloc() error handling
xen_ram_alloc() dies with hw_error() on error, even though its caller ram_block_add() handles errors just fine. Add an Error **errp parameter and use it. Leave case RUN_STATE_INMIGRATE alone, because that looks like some kind of warning. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
This commit is contained in:
parent
dced4d2fcb
commit
37aa7a0e2f
4 changed files with 14 additions and 6 deletions
8
exec.c
8
exec.c
|
@ -1474,6 +1474,7 @@ static ram_addr_t ram_block_add(RAMBlock *new_block, Error **errp)
|
|||
RAMBlock *block;
|
||||
RAMBlock *last_block = NULL;
|
||||
ram_addr_t old_ram_size, new_ram_size;
|
||||
Error *err = NULL;
|
||||
|
||||
old_ram_size = last_ram_offset() >> TARGET_PAGE_BITS;
|
||||
|
||||
|
@ -1483,7 +1484,12 @@ static ram_addr_t ram_block_add(RAMBlock *new_block, Error **errp)
|
|||
if (!new_block->host) {
|
||||
if (xen_enabled()) {
|
||||
xen_ram_alloc(new_block->offset, new_block->max_length,
|
||||
new_block->mr);
|
||||
new_block->mr, &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
qemu_mutex_unlock_ramlist();
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
new_block->host = phys_mem_alloc(new_block->max_length,
|
||||
&new_block->mr->align);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue