Received: from eggs.gnu.org ([2001:4830:134:3::10]:38173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YT7Dn-0000oK-39 for qemu-devel@nongnu.org; Wed, 04 Mar 2015 06:12:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YT7Di-0002F3-F4 for qemu-devel@nongnu.org; Wed, 04 Mar 2015 06:12:11 -0500 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:48060) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YT7Dh-0002Dm-RH for qemu-devel@nongnu.org; Wed, 04 Mar 2015 06:12:06 -0500 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 4 Mar 2015 16:42:02 +0530 From: Nikunj A Dadhania In-Reply-To: <87vbih6u7a.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> Date: Wed, 04 Mar 2015 16:41:46 +0530 Message-ID: <87h9u1nhjh.fsf@abhimanyu.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] Introduce machine specific default memory size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org Nikunj A Dadhania writes: > 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. > >> >>> + ram_size = machine_class->default_ram_size; >>> + >>> + /* if maxram size is not provided in options use machine default */ >>> + if (maxram_size == default_ram_size) { >>> + maxram_size = machine_class->default_ram_size; >>> + } >>> + } >>> + >>> /* store value for the future use */ >>> qemu_opt_set_number(qemu_find_opts_singleton("memory"), "size", ram_size); >> >> Does not apply to master, please name your prerequisite patches or >> rebase. > > > Rebased patch: > > > Introduce machine specific default memory size > > Qemu default memory of 128MB is not enough to boot sPAPR > guest. Introduce a member in the machine class to override the default > memory size enforced by qemu. > > Signed-off-by: Nikunj A Dadhania Ignore this, will be sending a v2