Received: from eggs.gnu.org ([2001:4830:134:3::10]:38874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJ27v-0002Km-6B for qemu-devel@nongnu.org; Mon, 09 Sep 2013 10:07:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJ27o-0004bZ-GV for qemu-devel@nongnu.org; Mon, 09 Sep 2013 10:07:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47110) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJ27o-0004YY-7p for qemu-devel@nongnu.org; Mon, 09 Sep 2013 10:07:32 -0400 Date: Mon, 9 Sep 2013 16:06:54 +0200 From: Igor Mammedov Message-ID: <20130909160654.7f76090f@nial.usersys.redhat.com> In-Reply-To: <51FC1794.7010406@suse.de> References: <1374596592-7027-1-git-send-email-imammedo@redhat.com> <1374596592-7027-3-git-send-email-imammedo@redhat.com> <51FC1794.7010406@suse.de> Mime-Version: 1.0 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: Andreas =?ISO-8859-1?B?RuRyYmVy?= Cc: vasilis.liaskovitis@profitbricks.com, hutao@cn.fujitsu.com, qemu-devel@nongnu.org, pbonzini@redhat.com On Fri, 02 Aug 2013 22:33:24 +0200 Andreas F=E4rber wrote: > Am 23.07.2013 18:22, schrieb Igor Mammedov: > > Signed-off-by: Igor Mammedov > > --- > > vl.c | 7 +------ > > 1 files changed, 1 insertions(+), 6 deletions(-) > >=20 > > 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); >=20 > 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 the > 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 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? >=20 > Andreas >=20