On Wed, 21 Nov 2018 at 02:07, Li Zhijian <lizhij...@cn.fujitsu.com> wrote:
>
> This patch allow load_iamge to load >=2G file
>
> Signed-off-by: Li Zhijian <lizhij...@cn.fujitsu.com>
> ---
>  hw/core/loader.c    | 5 +++--
>  include/hw/loader.h | 2 +-
>  2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/hw/core/loader.c b/hw/core/loader.c
> index aa0b3fc..0d53229 100644
> --- a/hw/core/loader.c
> +++ b/hw/core/loader.c
> @@ -75,9 +75,10 @@ int64_t get_image_size(const char *filename)
>
>  /* return the size or -1 if error */
>  /* deprecated, because caller does not specify buffer size! */
> -int load_image(const char *filename, uint8_t *addr)
> +ssize_t load_image(const char *filename, uint8_t *addr)
>  {
> -    int fd, size;
> +    int fd;
> +    ssize_t size;
>      fd = open(filename, O_RDONLY | O_BINARY);
>      if (fd < 0)
>          return -1;

Reviewed-by: Peter Maydell <peter.mayd...@linaro.org>

As the comment says, we should ideally move all the callers
to load_image_size(), though...

thanks
-- PMM

Reply via email to