summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-24 17:59:27 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-24 17:59:27 +0000
commit7fb4fdcffeb199c1a742c45ac2413be8a9a33354 (patch)
tree39c795fed9ae5e8d59afde1ca6031702cdd3224e /vl.c
parentc73f96fddc0f5ec7c708290f159b04cfa09ef713 (diff)
downloadqemu-7fb4fdcffeb199c1a742c45ac2413be8a9a33354.tar.gz
RAM usage information in machine definition.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4246 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/vl.c b/vl.c
index 78486cf10e..0825281ef9 100644
--- a/vl.c
+++ b/vl.c
@@ -8277,7 +8277,7 @@ int main(int argc, char **argv)
machine = first_machine;
cpu_model = NULL;
initrd_filename = NULL;
- ram_size = DEFAULT_RAM_SIZE * 1024 * 1024;
+ ram_size = -1;
vga_ram_size = VGA_RAM_SIZE;
#ifdef CONFIG_GDBSTUB
use_gdbstub = 0;
@@ -8963,7 +8963,25 @@ int main(int argc, char **argv)
#endif
/* init the memory */
- phys_ram_size = ram_size + vga_ram_size + MAX_BIOS_SIZE;
+ phys_ram_size = machine->ram_require & ~RAMSIZE_FIXED;
+
+ if (machine->ram_require & RAMSIZE_FIXED) {
+ if (ram_size > 0) {
+ if (ram_size < phys_ram_size) {
+ fprintf(stderr, "Machine `%s' requires %i bytes of memory\n",
+ machine->name, phys_ram_size);
+ exit(-1);
+ }
+
+ phys_ram_size = ram_size;
+ } else
+ ram_size = phys_ram_size;
+ } else {
+ if (ram_size < 0)
+ ram_size = DEFAULT_RAM_SIZE * 1024 * 1024;
+
+ phys_ram_size += ram_size;
+ }
phys_ram_base = qemu_vmalloc(phys_ram_size);
if (!phys_ram_base) {