On Mon, Mar 21, 2011 at 7:47 PM, Peter Maydell <peter.mayd...@linaro.org> wrote: > This fairly simple patchset adds a new 'max_ram' field to the QEMUMachine > structure so that a board model can specify the maximum RAM it will accept. > We can then produce a friendly diagnostic message when the user tries to > start qemu with a '-m' option asking for more RAM than that. (Currently > most of the ARM devboard models respond with an obscure guest crash when > the guest tries to access RAM and finds device registers instead.) > > If no maximum size is specified we default to the old behaviour of > "do not impose any limit". > > The advantage of doing this in vl.c rather than in each board (apart > from avoiding code duplication) is that we can distinguish between > "the user asked for more RAM than we support" (an error) and "the global > default RAM size is more than our maximum" (just cap the RAM size to > the board maximum).
This could replace the field max_mem in hwdef structures in sun4m.c. Another candidate for refactoring would be default_cpu_model.