[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC/PoC PATCH 2/3] change size type from int to int64_
From: |
Peter Maydell |
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 |
On 8 November 2018 at 10:59, Li Zhijian <address@hidden> wrote:
> allow load_image to load >= 2G file
>
> CC: Philip Li <address@hidden>
> Signed-off-by: Li Zhijian <address@hidden>
> ---
> 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
- [Qemu-devel] [RFC/PoC PATCH 0/3] support initrd size up to 4G, Li Zhijian, 2018/11/08
- Re: [Qemu-devel] [RFC/PoC PATCH 1/3] i386: set initrd_max to 4G - 1 to allow up to 4G initrd, Peter Maydell, 2018/11/08
- Re: [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
- Re: [Qemu-devel] [RFC/PoC PATCH 1/3] i386: set initrd_max to 4G - 1 to allow up to 4G initrd, Ingo Molnar, 2018/11/09
- Re: [Qemu-devel] [RFC/PoC PATCH 1/3] i386: set initrd_max to 4G - 1 to allow up to 4G initrd, Li Zhijian, 2018/11/09
- Re: [Qemu-devel] [RFC/PoC PATCH 1/3] i386: set initrd_max to 4G - 1 to allow up to 4G initrd, Juergen Gross, 2018/11/09
- Re: [Qemu-devel] [RFC/PoC PATCH 1/3] i386: set initrd_max to 4G - 1 to allow up to 4G initrd, Li Zhijian, 2018/11/09
- Re: [Qemu-devel] [RFC/PoC PATCH 1/3] i386: set initrd_max to 4G - 1 to allow up to 4G initrd, Li Zhijian, 2018/11/09
- Re: [Qemu-devel] [RFC/PoC PATCH 1/3] i386: set initrd_max to 4G - 1 to allow up to 4G initrd, H. Peter Anvin, 2018/11/09
- Re: [Qemu-devel] [RFC/PoC PATCH 1/3] i386: set initrd_max to 4G - 1 to allow up to 4G initrd, Ingo Molnar, 2018/11/12