qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: QEMU-devel <qemu-devel@nongnu.org>, Alexander Graf <agraf@suse.de>
Cc: Anthony PERARD <anthony.perard@citrix.com>,
	Xen Devel <xen-devel@lists.xensource.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Qemu-devel] [PATCH V2 3/3] vl.c: Check the asked ram_size later.
Date: Wed, 20 Jul 2011 19:17:44 +0100	[thread overview]
Message-ID: <1311185864-32745-4-git-send-email-anthony.perard@citrix.com> (raw)
In-Reply-To: <1311185864-32745-1-git-send-email-anthony.perard@citrix.com>

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.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 vl.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/vl.c b/vl.c
index fcd7395..c2efedf 100644
--- a/vl.c
+++ b/vl.c
@@ -2433,11 +2433,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);
@@ -3091,8 +3086,15 @@ 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;
+    } else 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);
-- 
Anthony PERARD

  parent reply	other threads:[~2011-07-20 18:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-20 18:17 [Qemu-devel] [PATCH V2 0/3] Enable QEMU to handle more than 2GB with Xen Anthony PERARD
2011-07-20 18:17 ` [Qemu-devel] [PATCH V2 1/3] cpu-common: Have a ram_addr_t of uint64 " Anthony PERARD
2011-07-20 18:17 ` [Qemu-devel] [PATCH V2 2/3] xen: Fix the memory registration to reflect of what is done by Xen Anthony PERARD
2011-07-20 18:17 ` Anthony PERARD [this message]
2011-07-27 12:53   ` [Qemu-devel] [PATCH V2 3/3] vl.c: Check the asked ram_size later Alexander Graf
2011-07-27 12:56 ` [Qemu-devel] [PATCH V2 0/3] Enable QEMU to handle more than 2GB with Xen Alexander Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1311185864-32745-4-git-send-email-anthony.perard@citrix.com \
    --to=anthony.perard@citrix.com \
    --cc=agraf@suse.de \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).