[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 78/86] exec: drop bogus mem_path from qemu_ram_alloc_from_fd()
From: |
Igor Mammedov |
Subject: |
[PATCH 78/86] exec: drop bogus mem_path from qemu_ram_alloc_from_fd() |
Date: |
Tue, 31 Dec 2019 14:04:02 +0100 |
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 <address@hidden>
---
exec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/exec.c b/exec.c
index 7b6e376..d0a7e7e 100644
--- a/exec.c
+++ b/exec.c
@@ -2308,9 +2308,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;
}
--
2.7.4
- [PATCH 61/86] ppc:mac_newworld: use memdev for RAM, (continued)
- [PATCH 61/86] ppc:mac_newworld: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 65/86] ppc:ppc405_boards: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 60/86] ppc:e500: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 74/86] sparc:niagara: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 68/86] ppc:prep: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 66/86] ppc:ppc440_bamboo/sam460ex: drop RAM size fixup, Igor Mammedov, 2019/12/31
- [PATCH 73/86] sparc:sun4m: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 75/86] remove no longer used memory_region_allocate_system_memory(), Igor Mammedov, 2019/12/31
- [PATCH 76/86] post conversion default_ram_id cleanup, Igor Mammedov, 2019/12/31
- [PATCH 77/86] exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize(), Igor Mammedov, 2019/12/31
- [PATCH 78/86] exec: drop bogus mem_path from qemu_ram_alloc_from_fd(),
Igor Mammedov <=
- [PATCH 80/86] hostmem: introduce "prealloc-threads" property, Igor Mammedov, 2019/12/31
- [PATCH 83/86] tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups, Igor Mammedov, 2019/12/31
- [PATCH 79/86] make mem_path local variable, Igor Mammedov, 2019/12/31
- [PATCH 85/86] numa: make exit() usage consistent, Igor Mammedov, 2019/12/31
- [PATCH 84/86] tests:numa-test: use explicit memdev to specify node RAM, Igor Mammedov, 2019/12/31
- [PATCH 82/86] numa: forbid '-numa node, mem' for 5.0 and newer machine types, Igor Mammedov, 2019/12/31
- [PATCH 81/86] hostmem: fix strict bind policy, Igor Mammedov, 2019/12/31
- [PATCH 86/86] numa: remove deprecated implicit RAM distribution between nodes, Igor Mammedov, 2019/12/31
- [PATCH 17/86] arm:imx25_pdk: drop RAM size fixup, Igor Mammedov, 2019/12/31
- [PATCH 38/86] arm:xlnx-versal-virt: use memdev for RAM, Igor Mammedov, 2019/12/31