mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
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>
This commit is contained in:
@@ -178,7 +178,7 @@ static CPUArchState *find_paging_enabled_cpu(CPUArchState *start_cpu)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int qemu_get_guest_memory_mapping(MemoryMappingList *list)
|
||||
void qemu_get_guest_memory_mapping(MemoryMappingList *list, Error **errp)
|
||||
{
|
||||
CPUArchState *env, *first_paging_enabled_cpu;
|
||||
RAMBlock *block;
|
||||
@@ -190,11 +190,11 @@ int qemu_get_guest_memory_mapping(MemoryMappingList *list)
|
||||
Error *err = NULL;
|
||||
cpu_get_memory_mapping(ENV_GET_CPU(env), list, &err);
|
||||
if (err) {
|
||||
error_free(err);
|
||||
return -1;
|
||||
error_propagate(errp, err);
|
||||
return;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -206,8 +206,6 @@ int qemu_get_guest_memory_mapping(MemoryMappingList *list)
|
||||
length = block->length;
|
||||
create_new_memory_mapping(list, offset, offset, length);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void qemu_get_guest_simple_memory_mapping(MemoryMappingList *list)
|
||||
|
||||
Reference in New Issue
Block a user