From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTTQS-0002nm-E2 for qemu-devel@nongnu.org; Thu, 05 Mar 2015 05:54:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTTQG-0002M8-Ec for qemu-devel@nongnu.org; Thu, 05 Mar 2015 05:54:44 -0500 Received: from e28smtp03.in.ibm.com ([122.248.162.3]:50458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTTQF-0002LD-QH for qemu-devel@nongnu.org; Thu, 05 Mar 2015 05:54:32 -0500 Received: from /spool/local by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 5 Mar 2015 16:24:27 +0530 From: Nikunj A Dadhania In-Reply-To: <20150305114138.1b4c8868@oc7435384737.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> <20150305114138.1b4c8868@oc7435384737.ibm.com> Date: Thu, 05 Mar 2015 16:24:21 +0530 Message-ID: <87mw3r3eaq.fsf@abhimanyu.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain 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: Thomas Huth Cc: aik@ozlabs.ru, armbru@redhat.com, agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, marcel.apfelbaum@gmail.com, Igor Mammedov Thomas Huth writes: > 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. Sure, I can then just use that input without warning/rejection. Regards Nikunj