diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-05-14 17:43:20 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-06-19 18:44:20 +0300 |
commit | 7f56e740a68c9f4ccebf7ad7590e82fbb30ffc87 (patch) | |
tree | cb8e9a6884921dcf55caf139884f34d2f4f93424 /include/exec/memory.h | |
parent | 0b183fc871e61f4a586fdef2c0f880b6a856e444 (diff) | |
download | qemu-7f56e740a68c9f4ccebf7ad7590e82fbb30ffc87.tar.gz qemu-7f56e740a68c9f4ccebf7ad7590e82fbb30ffc87.tar.bz2 qemu-7f56e740a68c9f4ccebf7ad7590e82fbb30ffc87.zip |
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
Diffstat (limited to 'include/exec/memory.h')
-rw-r--r-- | include/exec/memory.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h index 65ddb7a2a8..4c7bacf959 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -31,6 +31,7 @@ #include "qemu/queue.h" #include "qemu/int128.h" #include "qemu/notify.h" +#include "qapi/error.h" #define MAX_PHYS_ADDR_SPACE_BITS 62 #define MAX_PHYS_ADDR (((hwaddr)1 << MAX_PHYS_ADDR_SPACE_BITS) - 1) @@ -321,12 +322,14 @@ void memory_region_init_ram(MemoryRegion *mr, * @name: the name of the region. * @size: size of the region. * @path: the path in which to allocate the RAM. + * @errp: pointer to Error*, to store an error if it happens. */ 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); #endif /** |