[PATCH v4 5/7] memory: Clarify owner must not call memory_region_ref()

Akihiko Odaki posted 7 patches 3 months ago
[PATCH v4 5/7] memory: Clarify owner must not call memory_region_ref()
Posted by Akihiko Odaki 3 months ago
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 include/exec/memory.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/exec/memory.h b/include/exec/memory.h
index d79415a3b159..6698e9d05eab 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -1220,6 +1220,7 @@ void memory_region_init(MemoryRegion *mr,
  * memory_region_ref: Add a reference to a memory region
  *
  * This function adds a reference to the owner if present.
+ * The owner must not call this function as it results in a circular reference.
  * See docs/devel/memory.rst to know about owner.
  *
  * @mr: the #MemoryRegion

-- 
2.46.0
Re: [PATCH v4 5/7] memory: Clarify owner must not call memory_region_ref()
Posted by Peter Xu 2 months, 4 weeks ago
On Fri, Aug 23, 2024 at 03:13:10PM +0900, Akihiko Odaki wrote:
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
>  include/exec/memory.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/exec/memory.h b/include/exec/memory.h
> index d79415a3b159..6698e9d05eab 100644
> --- a/include/exec/memory.h
> +++ b/include/exec/memory.h
> @@ -1220,6 +1220,7 @@ void memory_region_init(MemoryRegion *mr,
>   * memory_region_ref: Add a reference to a memory region
>   *
>   * This function adds a reference to the owner if present.
> + * The owner must not call this function as it results in a circular reference.
>   * See docs/devel/memory.rst to know about owner.
>   *
>   * @mr: the #MemoryRegion

Please consider merging all four doc pre-update patches into one.

Thanks,

-- 
Peter Xu