qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Li Zhijian <lizhijian@cn.fujitsu.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Philip Li <philip.li@intel.com>,
	zhijianx.li@intel.com
Subject: Re: [Qemu-devel] [PATCH v2 2/5] change load_image() reture type to ssize_t
Date: Fri, 30 Nov 2018 13:47:44 +0000	[thread overview]
Message-ID: <CAFEAcA8pdUkPBYngX5_UKRf0OkGDtLZA99zMH07RWeRTh=+BvQ@mail.gmail.com> (raw)
In-Reply-To: <1542765966-20244-3-git-send-email-lizhijian@cn.fujitsu.com>

On Wed, 21 Nov 2018 at 02:07, Li Zhijian <lizhijian@cn.fujitsu.com> wrote:
>
> This patch allow load_iamge to load >=2G file
>
> Signed-off-by: Li Zhijian <lizhijian@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.maydell@linaro.org>

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

thanks
-- PMM

  parent reply	other threads:[~2018-11-30 13:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-21  2:06 [Qemu-devel] [PATCH v2 0/5] support loading initrd below 4G for recent kernel Li Zhijian
2018-11-21  2:06 ` [Qemu-devel] [PATCH v2 1/5] unify len and addr type for memory/address APIs Li Zhijian
2018-11-21  2:06   ` [Qemu-devel] [PATCH v2 2/5] change load_image() reture type to ssize_t Li Zhijian
2018-11-21  2:06     ` [Qemu-devel] [PATCH v2 3/5] refactor load_image/load_image_size Li Zhijian
2018-11-21  2:06       ` [Qemu-devel] [PATCH v2 4/5] x86: exit qemu if load_image fails Li Zhijian
2018-11-21  2:06         ` [Qemu-devel] [PATCH v2 5/5] x86: allow load initrd below 4G for recent linux Li Zhijian
2018-11-30 14:53           ` Michael S. Tsirkin
2018-12-03  6:12             ` Li Zhijian
2018-11-30 13:52         ` [Qemu-devel] [PATCH v2 4/5] x86: exit qemu if load_image fails Peter Maydell
2018-11-30 13:47     ` Peter Maydell [this message]
2018-11-30 15:14       ` [Qemu-devel] [PATCH v2 2/5] change load_image() reture type to ssize_t Peter Maydell
2018-12-03  6:16         ` Li Zhijian
2018-11-30 13:40   ` [Qemu-devel] [PATCH v2 1/5] unify len and addr type for memory/address APIs Peter Maydell
2018-12-03  6:42     ` Li Zhijian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFEAcA8pdUkPBYngX5_UKRf0OkGDtLZA99zMH07RWeRTh=+BvQ@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=philip.li@intel.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhijianx.li@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).