[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v2 11/16] softmmu/memory: add memory_region_try_add_subre

From: Philippe Mathieu-Daudé
Subject: Re: [RFC PATCH v2 11/16] softmmu/memory: add memory_region_try_add_subregion function
Date: Wed, 22 Sep 2021 19:42:39 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0

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.hedde@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é <philmd@redhat.com>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]