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] [RFC/PoC PATCH 2/3] change size type from int to int64_t on load_image()
Date: Thu, 8 Nov 2018 11:04:10 +0000 [thread overview]
Message-ID: <CAFEAcA8XBa2BSfWkSMyd-iQO_=RRcZ1atpUS3QnnoSoLHERkqg@mail.gmail.com> (raw)
In-Reply-To: <1541674784-25936-3-git-send-email-lizhijian@cn.fujitsu.com>
On 8 November 2018 at 10:59, Li Zhijian <lizhijian@cn.fujitsu.com> wrote:
> allow load_image to load >= 2G file
>
> CC: Philip Li <philip.li@intel.com>
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
> ---
> hw/core/loader.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/core/loader.c b/hw/core/loader.c
> index aa0b3fc..8fbc4bd 100644
> --- a/hw/core/loader.c
> +++ b/hw/core/loader.c
> @@ -77,7 +77,8 @@ int64_t get_image_size(const char *filename)
> /* deprecated, because caller does not specify buffer size! */
> int load_image(const char *filename, uint8_t *addr)
> {
> - int fd, size;
> + int fd;
> + int64_t size;
> fd = open(filename, O_RDONLY | O_BINARY);
> if (fd < 0)
> return -1;
This function returns "size", so changing the type of "size"
without also changing its return type looks wrong.
load_image_size() uses ssize_t here, which may be what we want.
thanks
-- PMM
next prev parent reply other threads:[~2018-11-08 11:04 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-08 10:59 [Qemu-devel] [RFC/PoC PATCH 0/3] support initrd size up to 4G Li Zhijian
2018-11-08 10:59 ` [Qemu-devel] [RFC/PoC PATCH 1/3] i386: set initrd_max to 4G - 1 to allow up to 4G initrd Li Zhijian
2018-11-08 10:59 ` [Qemu-devel] [RFC/PoC PATCH 2/3] change size type from int to int64_t on load_image() Li Zhijian
2018-11-08 10:59 ` [Qemu-devel] [PATCH 3/3] change int len to uin32_t len Li Zhijian
2018-11-08 11:14 ` Peter Maydell
2018-11-08 11:04 ` Peter Maydell [this message]
2018-11-09 2:48 ` [Qemu-devel] [RFC/PoC PATCH 2/3] change size type from int to int64_t on load_image() Li Zhijian
2018-11-08 11:06 ` [Qemu-devel] [RFC/PoC PATCH 1/3] i386: set initrd_max to 4G - 1 to allow up to 4G initrd Peter Maydell
2018-11-09 1:47 ` Li Zhijian
2018-11-09 7:20 ` Ingo Molnar
2018-11-09 9:57 ` Li Zhijian
2018-11-09 10:04 ` Juergen Gross
2018-11-09 13:11 ` Li Zhijian
2018-11-09 13:40 ` Li Zhijian
2018-11-09 21:10 ` H. Peter Anvin
2018-11-12 4:56 ` Ingo Molnar
2018-11-12 6:00 ` H. Peter Anvin
2018-11-12 6:19 ` Ingo Molnar
2018-11-12 6:36 ` H. Peter Anvin
2018-11-12 16:47 ` H. Peter Anvin
2018-11-08 20:12 ` [Qemu-devel] [RFC/PoC PATCH 0/3] support initrd size up to 4G Wainer dos Santos Moschetta
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='CAFEAcA8XBa2BSfWkSMyd-iQO_=RRcZ1atpUS3QnnoSoLHERkqg@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).