Received: from eggs.gnu.org ([2001:4830:134:3::10]:34819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uuspq-0005fn-Lw for qemu-devel@nongnu.org; Thu, 04 Jul 2013 19:21:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uuspp-0005M8-Nx for qemu-devel@nongnu.org; Thu, 04 Jul 2013 19:21:10 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35722 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uuspp-0005M0-CN for qemu-devel@nongnu.org; Thu, 04 Jul 2013 19:21:09 -0400 Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <87k3l6z7vg.fsf@blackfin.pond.sub.org> Date: Fri, 5 Jul 2013 01:21:02 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1372943363-24081-1-git-send-email-armbru@redhat.com> <1372943363-24081-8-git-send-email-armbru@redhat.com> <87k3l6z7vg.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH 7/7] vl: Tighten parsing of -machine option phandle_start List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org On 04.07.2013, at 17:01, Markus Armbruster wrote: > Alexander Graf writes: >=20 >> On 04.07.2013, at 15:09, Markus Armbruster wrote: >>=20 >>> Make it QEMU_OPT_NUMBER, so it gets parsed by generic code, which >>> actually bothers to check for errors, rather than its user, which >>> doesn't. >>>=20 >>> Cc: Alexander Graf >>> Signed-off-by: Markus Armbruster >>> --- >>> device_tree.c | 7 ++----- >>> vl.c | 2 +- >>> 2 files changed, 3 insertions(+), 6 deletions(-) >>>=20 >>> diff --git a/device_tree.c b/device_tree.c >>> index 0e7fe2d..10cf3d0 100644 >>> --- a/device_tree.c >>> +++ b/device_tree.c >>> @@ -240,11 +240,8 @@ uint32_t qemu_devtree_alloc_phandle(void *fdt) > uint32_t qemu_devtree_alloc_phandle(void *fdt) > { > static int phandle =3D 0x0; >=20 > /* >>> * which phandle id to start allocting phandles. >>> */ >>> if (!phandle) { >>> - const char *phandle_start =3D = qemu_opt_get(qemu_get_machine_opts(), >>> - "phandle_start"); >>> - if (phandle_start) { >>> - phandle =3D strtoul(phandle_start, NULL, 0); >>> - } >>> + phandle =3D qemu_opt_get_number(qemu_get_machine_opts(), >>> + "phandle_start", 0); >>=20 >> Zero is a valid phandle to start from. It shouldn't mean "default". >=20 > We get here only when phandle is zero (which it initially is). >=20 > If opts don't contain a value for "phandle_start", we set phandle to > zero, i.e. do nothing. Exactly the same as before. True. Sorry for the fuss. Acked-by: Alexander Graf Alex >=20 > If that's wrong, it should be fixed in a separate patch.