[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH REPOST v3 75/80] exec: drop bogus mem_path from qemu_ram_allo
From: |
Igor Mammedov |
Subject: |
Re: [PATCH REPOST v3 75/80] exec: drop bogus mem_path from qemu_ram_alloc_from_fd() |
Date: |
Fri, 24 Jan 2020 10:35:21 +0100 |
On Thu, 23 Jan 2020 12:38:40 +0100
Igor Mammedov <address@hidden> wrote:
> 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>
Marc-André,
git blames you as the one who introduced it,
could you take a look at this patch
probably I should add here as well
Fixes: 8d37b030fe ("exec: split file_ram_alloc()")
> ---
> CC: address@hidden
> CC: address@hidden
> ---
> exec.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/exec.c b/exec.c
> index 809987c..dc844fd 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;
> }
>
- [PATCH REPOST v3 67/80] ppc/spapr: use memdev for RAM, (continued)
- [PATCH REPOST v3 67/80] ppc/spapr: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 71/80] sparc/sun4m: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 72/80] sparc/niagara: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 69/80] ppc/virtex_ml507: use memdev for RAM, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 74/80] exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize(), Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 75/80] exec: drop bogus mem_path from qemu_ram_alloc_from_fd(), Igor Mammedov, 2020/01/23
- Re: [PATCH REPOST v3 75/80] exec: drop bogus mem_path from qemu_ram_alloc_from_fd(),
Igor Mammedov <=
- [PATCH REPOST v3 76/80] make mem_path local variable, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 77/80] hostmem: introduce "prealloc-threads" property, Igor Mammedov, 2020/01/23
- [PATCH REPOST v3 78/80] hostmem: fix strict bind policy, Igor Mammedov, 2020/01/23
[PATCH REPOST v3 73/80] remove no longer used memory_region_allocate_system_memory(), Igor Mammedov, 2020/01/23