Received: from eggs.gnu.org ([2001:4830:134:3::10]:43445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YT5mA-0004zl-81 for qemu-devel@nongnu.org; Wed, 04 Mar 2015 04:39:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YT5m6-0006vM-22 for qemu-devel@nongnu.org; Wed, 04 Mar 2015 04:39:34 -0500 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:42443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YT5m5-0006uJ-PZ for qemu-devel@nongnu.org; Wed, 04 Mar 2015 04:39:29 -0500 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 4 Mar 2015 09:39:25 -0000 Date: Wed, 4 Mar 2015 10:39:18 +0100 From: Thomas Huth Message-ID: <20150304103918.230ad0b6@oc7435384737.ibm.com> In-Reply-To: <87pp8p6rh2.fsf@linux.vnet.ibm.com> References: <1425387274-11133-1-git-send-email-nikunj@linux.vnet.ibm.com> <87zj7t2pit.fsf@blackfin.pond.sub.org> <87vbih6u7a.fsf@linux.vnet.ibm.com> <20150304095914.1d2af305@oc7435384737.ibm.com> <87sidl6smc.fsf@linux.vnet.ibm.com> <20150304101910.5dc7022b@oc7435384737.ibm.com> <87pp8p6rh2.fsf@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Introduce machine specific default memory size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikunj A Dadhania Cc: qemu-ppc@nongnu.org, Markus Armbruster , qemu-devel@nongnu.org On Wed, 04 Mar 2015 14:59:13 +0530 Nikunj A Dadhania wrote: > Thomas Huth writes: > > > On Wed, 04 Mar 2015 14:34:27 +0530 > > Nikunj A Dadhania wrote: > > > >> Thomas Huth writes: > >> > >> > On Wed, 04 Mar 2015 14:00:17 +0530 > >> > Nikunj A Dadhania wrote: > >> > > >> >> Markus Armbruster writes: > >> >> > >> >> > Nikunj A Dadhania writes: > >> >> > > >> >> >> diff --git a/vl.c b/vl.c > >> >> >> index eb89d62..dd56754 100644 > >> >> >> --- a/vl.c > >> >> >> +++ b/vl.c > >> >> >> @@ -4053,6 +4053,18 @@ int main(int argc, char **argv, char **envp) > >> >> >> exit(1); > >> >> >> } > >> >> >> > >> >> >> + if (machine_class->default_ram_size && ram_size < machine_class->default_ram_size) { > >> >> >> + fprintf(stderr, "qemu: %s guest ram size defaulting to %ld MB\n", > >> >> >> + machine_class->name, > >> >> >> + machine_class->default_ram_size / (1024 * 1024)); > >> >> > > >> >> > If the user explicitly asks for something, we either provide it > >> >> > silently, or we error out. This does neither. Why? > >> >> > >> >> In case the user has provided memory not enough to boot the machine, I > >> >> could error out. My idea was to have a sane default which is provided by > >> >> the machine. > >> >> > >> >> Initially, I had just "ram_size == default_ram_size", but then it was > >> >> allowing "-m 128M" to go through. And the VM would not boot. > >> >> > >> >> This can as well be converted to an error report and fail here to boot > >> >> the VM. > >> > > >> > What does exactly fail with 128MB? Linux? > >> > >> Linux kernel, and not much info as well on the console. > > > > Ok, but then I think it should still be possible to specify -m 128M on > > the command line - in case the user wants to run an older Linux which > > still works fine with that amount of memory. > > But how do we distinguish whether its old/new kernel in the distro? > > And the older kernel will boot with more memory, while the reverse isnt > true. True, and it's IMHO certainly ok to increase the default memory size - I just wanted to say that you should not disallow "-m 128M" in case the users know what they are doing. Thomas