From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJ2fO-0005Kb-JM for qemu-devel@nongnu.org; Mon, 09 Sep 2013 10:42:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJ2fJ-00085s-NC for qemu-devel@nongnu.org; Mon, 09 Sep 2013 10:42:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJ2fJ-00085h-F6 for qemu-devel@nongnu.org; Mon, 09 Sep 2013 10:42:09 -0400 Message-ID: <522DDBA7.3010405@redhat.com> Date: Mon, 09 Sep 2013 16:31:03 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1374596592-7027-1-git-send-email-imammedo@redhat.com> <1374596592-7027-3-git-send-email-imammedo@redhat.com> <51FC1794.7010406@suse.de> <20130909160654.7f76090f@nial.usersys.redhat.com> In-Reply-To: <20130909160654.7f76090f@nial.usersys.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 02/16] vl: set default ram_size during variable initialization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: vasilis.liaskovitis@profitbricks.com, hutao@cn.fujitsu.com, =?ISO-8859-1?Q?Andreas_F=E4rber?= , qemu-devel@nongnu.org Il 09/09/2013 16:06, Igor Mammedov ha scritto: > On Fri, 02 Aug 2013 22:33:24 +0200 > Andreas F=E4rber wrote: >=20 >> Am 23.07.2013 18:22, schrieb Igor Mammedov: >>> Signed-off-by: Igor Mammedov >>> --- >>> vl.c | 7 +------ >>> 1 files changed, 1 insertions(+), 6 deletions(-) >>> >>> diff --git a/vl.c b/vl.c >>> index 8190504..bf0c658 100644 >>> --- a/vl.c >>> +++ b/vl.c >>> @@ -2947,7 +2947,7 @@ int main(int argc, char **argv, char **envp) >>> module_call_init(MODULE_INIT_MACHINE); >>> machine =3D find_default_machine(); >>> cpu_model =3D NULL; >>> - ram_size =3D 0; >>> + ram_size =3D DEFAULT_RAM_SIZE * 1024 * 1024; >>> snapshot =3D 0; >>> cyls =3D heads =3D secs =3D 0; >>> translation =3D BIOS_ATA_TRANSLATION_AUTO; >>> @@ -4064,11 +4064,6 @@ int main(int argc, char **argv, char **envp) >>> exit(1); >>> } >>> =20 >>> - /* init the memory */ >>> - if (ram_size =3D=3D 0) { >>> - ram_size =3D DEFAULT_RAM_SIZE * 1024 * 1024; >>> - } >>> - >>> if (qemu_opts_foreach(qemu_find_opts("device"), device_help_func= , NULL, 0) >>> !=3D 0) { >>> exit(0); >> >> Commit message doesn't give any explanation why? > it was intended as cleanup >=20 >> >> What happens with -m 0? My guess is the old code translates that to th= e >> default size, where by intializing the default earlier it would stay. > patch is broken in this aspect. It aborts on start up with -m 0 >=20 > The question is if -m 0 is correct value, perhaps QEMU should exit with > error message in this case, instead of silent fallback to default? I guess we have to keep it for backwards compatibility. Paolo