summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-05-29 21:54:03 +0200
committerAndreas Färber <afaerber@suse.de>2013-06-11 19:38:13 +0200
commit11ed09cf0753c1288a97f00138fc4534135442bb (patch)
tree0e48a592cc26a93ded6af16a8ca95cdf57d3a418 /dump.c
parent1b3509ca5bbd8e7d2be92ac42196a3ee2e31cb03 (diff)
downloadqemu-11ed09cf0753c1288a97f00138fc4534135442bb.tar.gz
qemu-11ed09cf0753c1288a97f00138fc4534135442bb.tar.bz2
qemu-11ed09cf0753c1288a97f00138fc4534135442bb.zip
memory_mapping: Improve qemu_get_guest_memory_mapping() error reporting
Pass any Error out into dump_init() and have it actually stop on errors. Whether it is unsupported on a certain CPU can be checked by looking for a NULL CPUClass::get_memory_mapping field. Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> [AF: Reverted changes to CPU loops] Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/dump.c b/dump.c
index 87ca12cee0..44a1339c8a 100644
--- a/dump.c
+++ b/dump.c
@@ -707,6 +707,7 @@ static int dump_init(DumpState *s, int fd, bool paging, bool has_filter,
{
CPUArchState *env;
int nr_cpus;
+ Error *err = NULL;
int ret;
if (runstate_is_running()) {
@@ -757,7 +758,11 @@ static int dump_init(DumpState *s, int fd, bool paging, bool has_filter,
/* get memory mapping */
memory_mapping_list_init(&s->list);
if (paging) {
- qemu_get_guest_memory_mapping(&s->list);
+ qemu_get_guest_memory_mapping(&s->list, &err);
+ if (err != NULL) {
+ error_propagate(errp, err);
+ goto cleanup;
+ }
} else {
qemu_get_guest_simple_memory_mapping(&s->list);
}