aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2016-01-14 16:09:39 +0100
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2016-01-14 16:49:50 +0000
commit37aa7a0e2fc8219cbe2bda4b7d074b47a67ac917 (patch)
tree4891802a2840d852539c9b7170b3798bd1aaf323 /exec.c
parentdced4d2fcb3961358b12ec3a191dd04505f333af (diff)
downloadqemu-37aa7a0e2fc8219cbe2bda4b7d074b47a67ac917.zip
qemu-37aa7a0e2fc8219cbe2bda4b7d074b47a67ac917.tar.gz
qemu-37aa7a0e2fc8219cbe2bda4b7d074b47a67ac917.tar.bz2
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>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/exec.c b/exec.c
index 7f0ce42..c268c36 100644
--- a/exec.c
+++ b/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);