On 9/22/21 18:14, Damien Hedde wrote:
It allows to try to add a subregion to a memory region with error
handling. Like memory_region_add_subregion_overlap, it handles
priority as well.
Apart the error handling, the behavior is the same. It can be used
to do the simple memory_region_add_subregion() (with no overlap) by
setting the priority parameter to 0.
This commit is a preparation to further use this function in the
context of qmp command which needs error handling support.
Signed-off-by: Damien Hedde <damien.he...@greensocs.com>
---
Adding a new function is obviously not ideal. But there is ~900
occurrences of memory_region_add_subregion[_overlap] calls in the code
base. We do not really see an alternative here.
---
include/exec/memory.h | 22 ++++++++++++++++++++++
softmmu/memory.c | 22 ++++++++++++++--------
2 files changed, 36 insertions(+), 8 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <phi...@redhat.com>