Message ID | 1579779525-20065-17-git-send-email-imammedo@redhat.com |
---|---|
State | New |
Headers | show |
Series | refactor main RAM allocation to use hostmem backend | expand |
Igor> If the user provided too large a RAM size, the code used to
Igor> complain and trim it to the max size. Now tht RAM is allocated by
Igor> generic code, that's no longer possible, so generate an error and
Igor> exit instead.
You can add my 'reviewed-by' to this. There's one really minor typo in
the comment (tht->that) that you may wish to fix before the final
commit.
Reviewed-by: Peter Chubb <peter.chubb@data61.csiro.au>
On Thu, 23 Jan 2020 22:23:20 +0000 "Chubb, Peter (Data61, Kensington NSW)" <Peter.Chubb@data61.csiro.au> wrote: > Igor> If the user provided too large a RAM size, the code used to > Igor> complain and trim it to the max size. Now tht RAM is allocated by > Igor> generic code, that's no longer possible, so generate an error and > Igor> exit instead. > > You can add my 'reviewed-by' to this. There's one really minor typo in > the comment (tht->that) that you may wish to fix before the final > commit. Thanks, will do it in v4 (considering that there are already fixes to the current version, I'll rebase and repost) > > Reviewed-by: Peter Chubb <peter.chubb@data61.csiro.au> >
diff --git a/hw/arm/kzm.c b/hw/arm/kzm.c index 1d5ef28..94cbac1 100644 --- a/hw/arm/kzm.c +++ b/hw/arm/kzm.c @@ -25,6 +25,7 @@ #include "hw/char/serial.h" #include "sysemu/qtest.h" #include "sysemu/sysemu.h" +#include "qemu/cutils.h" /* Memory map for Kzm Emulation Baseboard: * 0x00000000-0x7fffffff See i.MX31 SOC for support @@ -78,10 +79,10 @@ static void kzm_init(MachineState *machine) /* Check the amount of memory is compatible with the SOC */ if (machine->ram_size > (FSL_IMX31_SDRAM0_SIZE + FSL_IMX31_SDRAM1_SIZE)) { - warn_report("RAM size " RAM_ADDR_FMT " above max supported, " - "reduced to %x", machine->ram_size, - FSL_IMX31_SDRAM0_SIZE + FSL_IMX31_SDRAM1_SIZE); - machine->ram_size = FSL_IMX31_SDRAM0_SIZE + FSL_IMX31_SDRAM1_SIZE; + char *sz = size_to_str(FSL_IMX31_SDRAM0_SIZE + FSL_IMX31_SDRAM1_SIZE); + error_report("RAM size more than %s is not supported", sz); + g_free(sz); + exit(EXIT_FAILURE); } memory_region_allocate_system_memory(&s->ram, NULL, "kzm.ram",