From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnqG1-00005f-T5 for qemu-devel@nongnu.org; Mon, 10 Nov 2014 09:48:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XnqFv-0005N9-Kq for qemu-devel@nongnu.org; Mon, 10 Nov 2014 09:47:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnqFv-0005N2-Cz for qemu-devel@nongnu.org; Mon, 10 Nov 2014 09:47:47 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAAElkm1026261 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 10 Nov 2014 09:47:46 -0500 Message-ID: <5460D00F.5060405@redhat.com> Date: Mon, 10 Nov 2014 15:47:43 +0100 From: Max Reitz MIME-Version: 1.0 References: <1415389165-16157-1-git-send-email-kwolf@redhat.com> <1415389165-16157-6-git-send-email-kwolf@redhat.com> In-Reply-To: <1415389165-16157-6-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 5/9] block: Factor bdrv_probe_all() out of find_image_format() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel@nongnu.org Cc: jcody@redhat.com, armbru@redhat.com, stefanha@redhat.com On 2014-11-07 at 20:39, Kevin Wolf wrote: > From: Markus Armbruster > > Signed-off-by: Markus Armbruster > Signed-off-by: Kevin Wolf > --- > block.c | 45 ++++++++++++++++++++++++++++++++------------- > 1 file changed, 32 insertions(+), 13 deletions(-) > > diff --git a/block.c b/block.c > index 4b5735c..2fdc33f 100644 > --- a/block.c > +++ b/block.c > @@ -648,11 +648,40 @@ BlockDriver *bdrv_find_protocol(const char *filename, > return NULL; > } > > +/* > + * Guess image format by probing its contents. > + * This is not a good idea when your image is raw (CVE-2008-2004), but > + * we do it anyway for backward compatibility. > + * @buf contains the image's first @buf_size bytes. > + * @buf_size is 2048 or the image's size, whatever is smaller. That is a funny parameter description. You should fix it in patch 6 (or directly here). Anyway, as for this patch (or with the comment saying "@buf_size should be at least 512" or something like that): Reviewed-by: Max Reitz