* [Qemu-devel] [PATCH] file_ram_alloc: propagate error to caller instead of terminating QEMU
@ 2015-10-19 17:11 Igor Mammedov
  2015-10-20 12:00 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Igor Mammedov @ 2015-10-19 17:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini
QEMU shouldn't exits from file_ram_alloc() if -mem-prealloc option is specified
and "object_add memory-backend-file,..." fails allocation during memory hotplug.
Propagate error to a caller and let it decide what to do with allocation failure.
That leaves QEMU alive if it can't create backend during hotplug time and
kills QEMU at startup time if backends or initial memory were misconfigured/
too large.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 exec.c | 4 ----
 1 file changed, 4 deletions(-)
diff --git a/exec.c b/exec.c
index 7d90a52..0aadd41 100644
--- a/exec.c
+++ b/exec.c
@@ -1292,10 +1292,6 @@ static void *file_ram_alloc(RAMBlock *block,
     return area;
 
 error:
-    if (mem_prealloc) {
-        error_report("%s", error_get_pretty(*errp));
-        exit(1);
-    }
     return NULL;
 }
 #endif
-- 
1.8.3.1
^ permalink raw reply related	[flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] file_ram_alloc: propagate error to caller instead of terminating QEMU
  2015-10-19 17:11 [Qemu-devel] [PATCH] file_ram_alloc: propagate error to caller instead of terminating QEMU Igor Mammedov
@ 2015-10-20 12:00 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2015-10-20 12:00 UTC (permalink / raw)
  To: Igor Mammedov, qemu-devel
On 19/10/2015 19:11, Igor Mammedov wrote:
> QEMU shouldn't exits from file_ram_alloc() if -mem-prealloc option is specified
> and "object_add memory-backend-file,..." fails allocation during memory hotplug.
> 
> Propagate error to a caller and let it decide what to do with allocation failure.
> That leaves QEMU alive if it can't create backend during hotplug time and
> kills QEMU at startup time if backends or initial memory were misconfigured/
> too large.
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
>  exec.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/exec.c b/exec.c
> index 7d90a52..0aadd41 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -1292,10 +1292,6 @@ static void *file_ram_alloc(RAMBlock *block,
>      return area;
>  
>  error:
> -    if (mem_prealloc) {
> -        error_report("%s", error_get_pretty(*errp));
> -        exit(1);
> -    }
>      return NULL;
>  }
>  #endif
> 
Queued, thanks.
Paolo
^ permalink raw reply	[flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-20 12:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-19 17:11 [Qemu-devel] [PATCH] file_ram_alloc: propagate error to caller instead of terminating QEMU Igor Mammedov
2015-10-20 12:00 ` 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).