mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
memory: add error propagation to file-based RAM allocation
Right now, -mem-path will fall back to RAM-based allocation in some cases. This should never happen with "-object memory-file", prepare the code by adding correct error propagation. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> MST: drop \n at end of error messages
This commit is contained in:
parent
0b183fc871
commit
7f56e740a6
5 changed files with 44 additions and 17 deletions
5
memory.c
5
memory.c
|
@ -1038,13 +1038,14 @@ void memory_region_init_ram_from_file(MemoryRegion *mr,
|
|||
struct Object *owner,
|
||||
const char *name,
|
||||
uint64_t size,
|
||||
const char *path)
|
||||
const char *path,
|
||||
Error **errp)
|
||||
{
|
||||
memory_region_init(mr, owner, name, size);
|
||||
mr->ram = true;
|
||||
mr->terminates = true;
|
||||
mr->destructor = memory_region_destructor_ram;
|
||||
mr->ram_addr = qemu_ram_alloc_from_file(size, mr, path);
|
||||
mr->ram_addr = qemu_ram_alloc_from_file(size, mr, path, errp);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue