diff mbox

Fix segfault with ram_size > 4095M without kvm

Message ID 20100223151314.GN17350@us.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ryan Harper Feb. 23, 2010, 3:13 p.m. UTC
None
diff mbox

Patch

diff --git a/vl.c b/vl.c
index db7a178..a659e98 100644
--- a/vl.c
+++ b/vl.c
@@ -5760,6 +5760,12 @@  int main(int argc, char **argv, char **envp)
             fprintf(stderr, "failed to initialize KVM\n");
             exit(1);
         }
+    } else {
+        /* without kvm enabled, we can only support 4095 MB RAM */
+        if (ram_size > (4095UL << 20)) {
+            fprintf(stderr, "qemu: without kvm support at most 4095 MB RAM can be simulated\n");
+            exit(1);
+        }
     }
 
     if (qemu_init_main_loop()) {