|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PATCH RFC 3/4] exec: don't exit unconditionally if failed to allocate memory |
Date: | Mon, 16 Jun 2014 12:07:17 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
Il 16/06/2014 11:54, Hu Tao ha scritto:
> > This needs an audit of all callers or, alternatively, we need to add > > memory_region_init_ram_nofail. Better leave it for after the merge.Paolo, IIUC you suggested we fix it after merge.
Yes.
> Specifically memory_region_init_ram_from_file does not seem to > handle failures.memory_region_init_ram_from_file has an errp. Also see my updated patch.
Yes, memory_region_init_ram_from_file is okay. memory_region_init_ram is the one that doesn't handle failures.
> qemu_ram_free chunk also looks weird. Can we not avoid calling > free on invalid addresses? but we still need to check the address somewhere if not in qemu_ram_free.
If we add an errp to memory_region_init_ram, the qemu_ram_free hunk probably will not be necessary anymore.
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |