提交 cc57501d 编写于 作者: I Igor Mammedov 提交者: Paolo Bonzini

file_ram_alloc: propagate error to caller instead of terminating QEMU

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: NIgor Mammedov <imammedo@redhat.com>
Message-Id: <1445274671-17704-1-git-send-email-imammedo@redhat.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 7bc8e0c9
......@@ -1282,10 +1282,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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册