From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=50206 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqVBc-0006CJ-UV for qemu-devel@nongnu.org; Thu, 26 Jan 2012 14:40:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RqVBY-0005om-6E for qemu-devel@nongnu.org; Thu, 26 Jan 2012 14:40:44 -0500 Received: from mail-qw0-f45.google.com ([209.85.216.45]:46358) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqVBX-0005og-VZ for qemu-devel@nongnu.org; Thu, 26 Jan 2012 14:40:40 -0500 Received: by qabg40 with SMTP id g40so222179qab.4 for ; Thu, 26 Jan 2012 11:40:39 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <75020d27a76d9b884a9c40d8c6ec81b525ab96a9.1327302677.git.peter.crosthwaite@petalogix.com> References: <75020d27a76d9b884a9c40d8c6ec81b525ab96a9.1327302677.git.peter.crosthwaite@petalogix.com> Date: Thu, 26 Jan 2012 19:40:38 +0000 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH 5/7] vl.c: added -kerndtb option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Peter A. G. Crosthwaite" Cc: monstr@monstr.eu, edgar.iglesias@petalogix.com, qemu-devel@nongnu.org, duyl@xilinx.com, linnj@xilinx.com, john.williams@petalogix.com On 23 January 2012 07:20, Peter A. G. Crosthwaite wrote: > --- a/vl.c > +++ b/vl.c > @@ -233,6 +233,7 @@ int boot_menu; > =C2=A0uint8_t *boot_splash_filedata; > =C2=A0int boot_splash_filedata_size; > =C2=A0uint8_t qemu_extra_params_fw[2]; > +const char *qemu_kerndtb =3D NULL; > > =C2=A0typedef struct FWBootEntry FWBootEntry; > > @@ -2437,6 +2438,9 @@ int main(int argc, char **argv, char **envp) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 case QEMU_OPTION_kernel: > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 kernel_filename = =3D optarg; > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break; > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case QEMU_OPTION_kerndtb: > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0qemu_kerndtb =3D= optarg; > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break; > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 case QEMU_OPTION_append: > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 kernel_cmdline = =3D optarg; > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break; This is inconsistent with how we handle kernel_filename and initrd_filename (throwing things around via random globals is a pretty nasty interface). I think I like the approach Grant Likely suggested of cleaning up the machine->init function signature so we just pass it a struct instead. Also missing the mollyguard on attempting to use -kernel-dtb but not -kernel (cf the check done for -append and -initrd). -- PMM