aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2020-02-19 11:09:48 -0500
committerPatchew Importer <importer@patchew.org>2020-02-19 16:50:01 +0000
commitc001c3b3d93a645d9f0e5cc3638937abc8b8f7f7 (patch)
treef0c6f2a2ab39a1a27369265f290b6906b7de059c /exec.c
parentad1172d8e56e7787ad443d32a97193ac58bf2f17 (diff)
downloadqemu-c001c3b3d93a645d9f0e5cc3638937abc8b8f7f7.zip
qemu-c001c3b3d93a645d9f0e5cc3638937abc8b8f7f7.tar.gz
qemu-c001c3b3d93a645d9f0e5cc3638937abc8b8f7f7.tar.bz2
exec: drop bogus mem_path from qemu_ram_alloc_from_fd()
Function will report error that will mention global mem_path, which was valid the only if legacy -mem-path was used and only in case of main RAM. However it doesn't work with hostmem backends (for example: " qemu: -object memory-backend-file,id=ram0,size=128M,mem-path=foo: backing store (null) size 0x200000 does not match 'size' option 0x8000000 ") and couldn't possibly work in general FD case the function is supposed to handle. Taking in account that main RAM was converted into memory-backend-foo object, there is no point in printing file name (from inappropriate place) as failing path is a part of backend's error message. Hence drop bogus mem_path usage from qemu_ram_alloc_from_fd(), it's a job of its user to add file name to error message if applicable. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20200219160953.13771-75-imammedo@redhat.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/exec.c b/exec.c
index d85a868..6ebff8b 100644
--- a/exec.c
+++ b/exec.c
@@ -2307,9 +2307,9 @@ RAMBlock *qemu_ram_alloc_from_fd(ram_addr_t size, MemoryRegion *mr,
size = HOST_PAGE_ALIGN(size);
file_size = get_file_size(fd);
if (file_size > 0 && file_size < size) {
- error_setg(errp, "backing store %s size 0x%" PRIx64
+ error_setg(errp, "backing store size 0x%" PRIx64
" does not match 'size' option 0x" RAM_ADDR_FMT,
- mem_path, file_size, size);
+ file_size, size);
return NULL;
}