diff options
author | Anthony PERARD <anthony.perard@citrix.com> | 2011-07-20 08:17:44 +0000 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2011-07-26 07:02:10 +0200 |
commit | 834e76ea1cc3f6fb261fe6a40f7571600bcb25b1 (patch) | |
tree | 052ffe3d18dc1b0075cfddd81c2fdcf4be6e25fd /vl.c | |
parent | 8a369e20e701c9d220834e0daa027e65acd35214 (diff) | |
download | qemu-834e76ea1cc3f6fb261fe6a40f7571600bcb25b1.zip qemu-834e76ea1cc3f6fb261fe6a40f7571600bcb25b1.tar.gz qemu-834e76ea1cc3f6fb261fe6a40f7571600bcb25b1.tar.bz2 |
vl.c: Check the asked ram_size later.
As a Xen guest can have more than 2GB of RAM on a 32bit host, we move
the conditions after than we now if we run one Xen or not.
[agraf] separate xen branch from ram_size check
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -2440,11 +2440,6 @@ int main(int argc, char **argv, char **envp) exit(1); } - /* On 32-bit hosts, QEMU is limited by virtual address space */ - if (value > (2047 << 20) && HOST_LONG_BITS == 32) { - fprintf(stderr, "qemu: at most 2047 MB RAM can be simulated\n"); - exit(1); - } if (value != (uint64_t)(ram_addr_t)value) { fprintf(stderr, "qemu: ram size too large\n"); exit(1); @@ -3099,8 +3094,17 @@ int main(int argc, char **argv, char **envp) exit(1); /* init the memory */ - if (ram_size == 0) + if (ram_size == 0) { ram_size = DEFAULT_RAM_SIZE * 1024 * 1024; + } + + if (!xen_enabled()) { + /* On 32-bit hosts, QEMU is limited by virtual address space */ + if (ram_size > (2047 << 20) && HOST_LONG_BITS == 32) { + fprintf(stderr, "qemu: at most 2047 MB RAM can be simulated\n"); + exit(1); + } + } /* init the dynamic translator */ cpu_exec_init_all(tb_size * 1024 * 1024); |