qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] loader: support loading large files (>=2GB)


From: Richard Henderson
Subject: Re: [PATCH] loader: support loading large files (>=2GB)
Date: Fri, 29 Apr 2022 10:53:20 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0

On 4/27/22 16:07, Peter Collingbourne wrote:
Currently the loader uses int as the return type for various APIs
that deal with file sizes, which leads to an error if the file
size is >=2GB, as it ends up being interpreted as a negative error
code. Furthermore, we do not tolerate short reads, which are possible
at least on Linux when attempting to read such large files in one
syscall.

Fix the first problem by switching to 64-bit types for file sizes,
and fix the second by introducing a loop around the read syscall.

Signed-off-by: Peter Collingbourne<pcc@google.com>
---
  hw/core/generic-loader.c |  2 +-
  hw/core/loader.c         | 44 ++++++++++++++++++++++++----------------
  include/hw/loader.h      | 13 ++++++------
  3 files changed, 34 insertions(+), 25 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]