From patchwork Tue Feb 23 15:13:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Harper X-Patchwork-Id: 81473 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1NFE3xf012059 for ; Tue, 23 Feb 2010 15:14:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753044Ab0BWPNw (ORCPT ); Tue, 23 Feb 2010 10:13:52 -0500 Received: from e33.co.us.ibm.com ([32.97.110.151]:38819 "EHLO e33.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752991Ab0BWPNv (ORCPT ); Tue, 23 Feb 2010 10:13:51 -0500 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by e33.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id o1NFAK4P018078 for ; Tue, 23 Feb 2010 08:10:21 -0700 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o1NFDKdD103262 for ; Tue, 23 Feb 2010 08:13:23 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o1NFDJjY008744 for ; Tue, 23 Feb 2010 08:13:20 -0700 Received: from localhost.localdomain (frylock.austin.ibm.com [9.53.41.12]) by d03av02.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o1NFDJIj008716; Tue, 23 Feb 2010 08:13:19 -0700 Received: by localhost.localdomain (Postfix, from userid 1000) id E18171BF82; Tue, 23 Feb 2010 09:13:14 -0600 (CST) Date: Tue, 23 Feb 2010 09:13:14 -0600 From: Ryan Harper To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org Subject: [PATCH] Fix segfault with ram_size > 4095M without kvm Message-ID: <20100223151314.GN17350@us.ibm.com> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 23 Feb 2010 15:14:04 +0000 (UTC) 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()) {