qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] system: Use &error_abort in memory_region_init_ram_[device_]ptr()
@ 2023-11-20 13:31 Philippe Mathieu-Daudé
  2023-11-20 13:45 ` David Hildenbrand
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-11-20 13:31 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Markus Armbruster, Peter Xu,
	Philippe Mathieu-Daudé, David Hildenbrand

If an unexpected error condition happens, we have to abort
(&fatal_error is meant for expected errors).

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 system/memory.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/system/memory.c b/system/memory.c
index 304fa843ea..4d9cb0a7ff 100644
--- a/system/memory.c
+++ b/system/memory.c
@@ -1692,7 +1692,7 @@ void memory_region_init_ram_ptr(MemoryRegion *mr,
 
     /* qemu_ram_alloc_from_ptr cannot fail with ptr != NULL.  */
     assert(ptr != NULL);
-    mr->ram_block = qemu_ram_alloc_from_ptr(size, ptr, mr, &error_fatal);
+    mr->ram_block = qemu_ram_alloc_from_ptr(size, ptr, mr, &error_abort);
 }
 
 void memory_region_init_ram_device_ptr(MemoryRegion *mr,
@@ -1711,7 +1711,7 @@ void memory_region_init_ram_device_ptr(MemoryRegion *mr,
 
     /* qemu_ram_alloc_from_ptr cannot fail with ptr != NULL.  */
     assert(ptr != NULL);
-    mr->ram_block = qemu_ram_alloc_from_ptr(size, ptr, mr, &error_fatal);
+    mr->ram_block = qemu_ram_alloc_from_ptr(size, ptr, mr, &error_abort);
 }
 
 void memory_region_init_alias(MemoryRegion *mr,
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] system: Use &error_abort in memory_region_init_ram_[device_]ptr()
  2023-11-20 13:31 [PATCH] system: Use &error_abort in memory_region_init_ram_[device_]ptr() Philippe Mathieu-Daudé
@ 2023-11-20 13:45 ` David Hildenbrand
  2023-11-21  8:01 ` Markus Armbruster
  2023-11-21 15:49 ` Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: David Hildenbrand @ 2023-11-20 13:45 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Paolo Bonzini, Markus Armbruster, Peter Xu

On 20.11.23 14:31, Philippe Mathieu-Daudé wrote:
> If an unexpected error condition happens, we have to abort
> (&fatal_error is meant for expected errors).
> 
> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> Suggested-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   system/memory.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/system/memory.c b/system/memory.c
> index 304fa843ea..4d9cb0a7ff 100644
> --- a/system/memory.c
> +++ b/system/memory.c
> @@ -1692,7 +1692,7 @@ void memory_region_init_ram_ptr(MemoryRegion *mr,
>   
>       /* qemu_ram_alloc_from_ptr cannot fail with ptr != NULL.  */
>       assert(ptr != NULL);
> -    mr->ram_block = qemu_ram_alloc_from_ptr(size, ptr, mr, &error_fatal);
> +    mr->ram_block = qemu_ram_alloc_from_ptr(size, ptr, mr, &error_abort);
>   }
>   
>   void memory_region_init_ram_device_ptr(MemoryRegion *mr,
> @@ -1711,7 +1711,7 @@ void memory_region_init_ram_device_ptr(MemoryRegion *mr,
>   
>       /* qemu_ram_alloc_from_ptr cannot fail with ptr != NULL.  */
>       assert(ptr != NULL);
> -    mr->ram_block = qemu_ram_alloc_from_ptr(size, ptr, mr, &error_fatal);
> +    mr->ram_block = qemu_ram_alloc_from_ptr(size, ptr, mr, &error_abort);
>   }
>   
>   void memory_region_init_alias(MemoryRegion *mr,

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Cheers,

David / dhildenb



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] system: Use &error_abort in memory_region_init_ram_[device_]ptr()
  2023-11-20 13:31 [PATCH] system: Use &error_abort in memory_region_init_ram_[device_]ptr() Philippe Mathieu-Daudé
  2023-11-20 13:45 ` David Hildenbrand
@ 2023-11-21  8:01 ` Markus Armbruster
  2023-11-21 15:49 ` Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Markus Armbruster @ 2023-11-21  8:01 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Paolo Bonzini, Peter Xu, David Hildenbrand

Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> If an unexpected error condition happens, we have to abort
> (&fatal_error is meant for expected errors).
>
> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> Suggested-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] system: Use &error_abort in memory_region_init_ram_[device_]ptr()
  2023-11-20 13:31 [PATCH] system: Use &error_abort in memory_region_init_ram_[device_]ptr() Philippe Mathieu-Daudé
  2023-11-20 13:45 ` David Hildenbrand
  2023-11-21  8:01 ` Markus Armbruster
@ 2023-11-21 15:49 ` Paolo Bonzini
  2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2023-11-21 15:49 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Markus Armbruster, Peter Xu, David Hildenbrand

Queued, thanks.

Paolo



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-21 15:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-20 13:31 [PATCH] system: Use &error_abort in memory_region_init_ram_[device_]ptr() Philippe Mathieu-Daudé
2023-11-20 13:45 ` David Hildenbrand
2023-11-21  8:01 ` Markus Armbruster
2023-11-21 15:49 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).