Received: from eggs.gnu.org ([2001:4830:134:3::10]:54055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9XnE-0008Oo-Bt for qemu-devel@nongnu.org; Wed, 14 Aug 2013 05:55:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9Xn8-00035z-Bl for qemu-devel@nongnu.org; Wed, 14 Aug 2013 05:55:04 -0400 Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <1376392181-30110-1-git-send-email-real@ispras.ru> Date: Wed, 14 Aug 2013 11:51:19 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <305EDCD1-E38D-4953-9935-9DAADFFEDD90@suse.de> References: <1376392181-30110-1-git-send-email-real@ispras.ru> Subject: Re: [Qemu-devel] [PATCH] ppc: virtex_ml507: QEMU_OPTION_dtb support for this machine. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Efimov Vasily Cc: "Edgar E. Iglesias" , qemu-ppc@nongnu.org, qemu-devel@nongnu.org On 13.08.2013, at 13:09, Efimov Vasily wrote: >=20 > Signed-off-by: Efimov Vasily Please provide a patch description :). > --- > hw/ppc/virtex_ml507.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) >=20 > diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c > index 08e77fb..a00f709 100644 > --- a/hw/ppc/virtex_ml507.c > +++ b/hw/ppc/virtex_ml507.c > @@ -141,11 +141,18 @@ static int xilinx_load_device_tree(hwaddr addr, > { > char *path; > int fdt_size; > - void *fdt; > + void *fdt =3D 0; This should be NULL. NULL doesn't have to be 0 according to C IIRC. > int r; > + const char *dtb_filename; >=20 > - /* Try the local "ppc.dtb" override. */ > - fdt =3D load_device_tree("ppc.dtb", &fdt_size); > + dtb_filename =3D qemu_opt_get(qemu_get_machine_opts(), "dtb"); > + if (dtb_filename) { > + fdt =3D load_device_tree(dtb_filename, &fdt_size); > + } > + if (!fdt) { > + /* Try the local "ppc.dtb" override. */ > + fdt =3D load_device_tree("ppc.dtb", &fdt_size); > + } Could you please just remove the ppc.dtb override option? It's = superfluous once we have proper -dtb support. Edgar, any objections? Also, you should abort if the user specified a dtb through -dtb and that = file could not get loaded. Alex > if (!fdt) { > path =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, = BINARY_DEVICE_TREE_FILE); > if (path) { > --=20 > 1.7.10.4 >=20