From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcYxi-0001ny-Mp for qemu-devel@nongnu.org; Fri, 10 Oct 2014 08:06:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XcYxc-0001f1-I9 for qemu-devel@nongnu.org; Fri, 10 Oct 2014 08:06:22 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:58609 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcYxc-0001ev-CL for qemu-devel@nongnu.org; Fri, 10 Oct 2014 08:06:16 -0400 Date: Fri, 10 Oct 2014 14:03:47 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20141010120347.GC10091@irqsave.net> References: <1408215258-12545-1-git-send-email-mreitz@redhat.com> <1408215258-12545-3-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1408215258-12545-3-git-send-email-mreitz@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/3] qemu-io: Respect early image end for map List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi > + } else if (!num) { > + error_report("Unexpected end of image"); > + return 0; I think this test can miss some case of Unexpected end of image. For example supose that in map_is_allocated the first bdrv_is_allocated actually succeed then *pnum =3D num. Then the bottom loop has exit on fai= lure and the function return. in map_f &num is map_is_allocated *pnum so map_f's num !=3D 0 and this ve= ry test fails to see the unexpected end of image error. Best regards Beno=EEt > } > =20 > retstr =3D ret ? " allocated" : "not allocated"; > --=20 > 2.0.4 >=20 >=20