diff options
author | Markus Armbruster <armbru@redhat.com> | 2016-01-14 16:09:39 +0100 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2016-01-14 16:49:50 +0000 |
commit | 37aa7a0e2fc8219cbe2bda4b7d074b47a67ac917 (patch) | |
tree | 4891802a2840d852539c9b7170b3798bd1aaf323 /xen-hvm.c | |
parent | dced4d2fcb3961358b12ec3a191dd04505f333af (diff) | |
download | qemu-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 'xen-hvm.c')
-rw-r--r-- | xen-hvm.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -239,9 +239,9 @@ static void xen_ram_init(PCMachineState *pcms, } } -void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr) +void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr, + Error **errp) { - /* FIXME caller ram_block_add() wants error_setg() on failure */ unsigned long nr_pfn; xen_pfn_t *pfn_list; int i; @@ -268,7 +268,8 @@ void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr) } if (xc_domain_populate_physmap_exact(xen_xc, xen_domid, nr_pfn, 0, 0, pfn_list)) { - hw_error("xen: failed to populate ram at " RAM_ADDR_FMT, ram_addr); + error_setg(errp, "xen: failed to populate ram at " RAM_ADDR_FMT, + ram_addr); } g_free(pfn_list); |