mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
change get_image_size return type to int64_t
Previously, if the size of initrd >=2G, qemu exits with error: root@haswell-OptiPlex-9020:/home/lizj# /home/lizhijian/lkp/qemu-colo/x86_64-softmmu/qemu-system-x86_64 -kernel ./vmlinuz-4.16.0-rc4 -initrd large.cgz -nographic qemu: error reading initrd large.cgz: No such file or directory root@haswell-OptiPlex-9020:/home/lizj# du -sh large.cgz 2.5G large.cgz this patch changes the caller side that use this function to calculate size of initrd file as well. v2: update error message and int64_t printing format Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com> Message-Id: <1536833233-14121-1-git-send-email-lizhijian@cn.fujitsu.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
90a84d131c
commit
f3839fda57
10 changed files with 24 additions and 18 deletions
|
@ -995,8 +995,8 @@ static void GCC_FMT_ATTR(3, 4) prom_set(uint32_t* prom_buf, int index,
|
|||
/* Kernel */
|
||||
static int64_t load_kernel (void)
|
||||
{
|
||||
int64_t kernel_entry, kernel_high;
|
||||
long kernel_size, initrd_size;
|
||||
int64_t kernel_entry, kernel_high, initrd_size;
|
||||
long kernel_size;
|
||||
ram_addr_t initrd_offset;
|
||||
int big_endian;
|
||||
uint32_t *prom_buf;
|
||||
|
@ -1070,7 +1070,7 @@ static int64_t load_kernel (void)
|
|||
|
||||
prom_set(prom_buf, prom_index++, "%s", loaderparams.kernel_filename);
|
||||
if (initrd_size > 0) {
|
||||
prom_set(prom_buf, prom_index++, "rd_start=0x%" PRIx64 " rd_size=%li %s",
|
||||
prom_set(prom_buf, prom_index++, "rd_start=0x%" PRIx64 " rd_size=%" PRId64 " %s",
|
||||
xlate_to_kseg0(NULL, initrd_offset), initrd_size,
|
||||
loaderparams.kernel_cmdline);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue