hw/pci-host/prep: Do not use hw_error() in realize function
commitfb38ebfbfe16ed776a895869d2a018c9d417b754
authorThomas Huth <thuth@redhat.com>
Thu, 9 Feb 2017 11:14:41 +0000 (9 12:14 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 22 Feb 2017 00:28:28 +0000 (22 11:28 +1100)
tree5e52894bed796d00ec3fa064d70a7c7f83020c47
parent506590836144af7d0de3fc4c691bb5ed49d41645
hw/pci-host/prep: Do not use hw_error() in realize function

hw_error() is for CPU related errors only (it prints out a
register dump and calls abort()), so we should not use it
if we just failed to load the bios image. Apart from that,
realize() functions should not exit directly but always set
the errp with error_setg() in case of errors instead.
Additionally, move some code around and delete the bios memory
subregion again in case of such an error, so that we leave a
clean state when returning to the caller.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/pci-host/prep.c