From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTTEA-0006pP-Kf for qemu-devel@nongnu.org; Thu, 05 Mar 2015 05:42:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTTE0-0005nK-0w for qemu-devel@nongnu.org; Thu, 05 Mar 2015 05:42:02 -0500 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:38799) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTTDz-0005ml-PC for qemu-devel@nongnu.org; Thu, 05 Mar 2015 05:41:51 -0500 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 5 Mar 2015 10:41:49 -0000 Date: Thu, 5 Mar 2015 11:41:38 +0100 From: Thomas Huth Message-ID: <20150305114138.1b4c8868@oc7435384737.ibm.com> In-Reply-To: <87pp8n3fcj.fsf@abhimanyu.in.ibm.com> References: <1425546371-15909-1-git-send-email-nikunj@linux.vnet.ibm.com> <1425546371-15909-2-git-send-email-nikunj@linux.vnet.ibm.com> <20150305111707.5a8c797f@nial.brq.redhat.com> <87pp8n3fcj.fsf@abhimanyu.in.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 1/2] machine: add default_ram_size to machine class List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikunj A Dadhania Cc: aik@ozlabs.ru, armbru@redhat.com, agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, marcel.apfelbaum@gmail.com, Igor Mammedov On Thu, 05 Mar 2015 16:01:40 +0530 Nikunj A Dadhania wrote: > Hi Igor, > > Thanks for the review. > > Igor Mammedov writes: > > On Thu, 5 Mar 2015 14:36:10 +0530 > > Nikunj A Dadhania wrote: > > > >> Machines types can have different requirement for default ram > >> size. Introduce a member in the machine class and set the current > >> default_ram_size to 128MB. > >> > >> For QEMUMachine types override the value during the registration of > >> the machine and for MachineClass introduce the generic class init > >> setting the default_ram_size. > >> > >> In case the user passes memory that is lesser that the default ram > >> size, upscale the value to the machine's default ram size with a > >> warning. ... > >> @@ -2684,6 +2683,12 @@ static void set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_size) > >> exit(EXIT_FAILURE); > >> } > >> > >> + if (ram_size < default_ram_size) { > >> + fprintf(stderr, "WARNING: qemu: %s guest ram size defaulting to %ld MB\n", > >> + mc->name, default_ram_size / (1024 * 1024)); > >> + ram_size = default_ram_size; > >> + } > > In previous review someone explicitly asked not to override lower ram_size > > if it was requested by user on command line. > > We would get to a state where the VM is not bootable. I understand that > user has provided a value, but what if the value is not correct? Well, as I said before: There are older versions of Linux which run fine with 128 MB or even 64 MB of memory. Do you really want to block this just because newer Linux distros now need more RAM now by default? IMHO if the user specified the amount of RAM at the command line, you can assume that they know what they are doing. Thomas