From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIEhD-0002zt-3L for qemu-devel@nongnu.org; Wed, 20 Mar 2013 04:48:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIEh4-0001VT-Rn for qemu-devel@nongnu.org; Wed, 20 Mar 2013 04:48:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIEh4-0001Uq-Hf for qemu-devel@nongnu.org; Wed, 20 Mar 2013 04:48:22 -0400 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 r2K8mLAI007728 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Mar 2013 04:48:21 -0400 Date: Wed, 20 Mar 2013 09:48:19 +0100 From: Kevin Wolf Message-ID: <20130320084819.GB3074@dhcp-200-207.str.redhat.com> References: <1363627441-8297-1-git-send-email-kwolf@redhat.com> <1363627441-8297-10-git-send-email-kwolf@redhat.com> <51491B70.7000302@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51491B70.7000302@redhat.com> Subject: Re: [Qemu-devel] [PATCH 09/11] block: Make find_image_format safe with NULL filename List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: pbonzini@redhat.com, qemu-devel@nongnu.org Am 20.03.2013 um 03:14 hat Eric Blake geschrieben: > On 03/18/2013 11:23 AM, Kevin Wolf wrote: > > In order to achieve this, the .bdrv_probe callbacks of all drivers must > > cope with this. The DMG driver is the only one that bases its decision > > on the filename and it needs to be changed. > > > > Signed-off-by: Kevin Wolf > > --- > > block/dmg.c | 13 ++++++++++--- > > 1 file changed, 10 insertions(+), 3 deletions(-) > > Reviewed-by: Eric Blake > > > > > diff --git a/block/dmg.c b/block/dmg.c > > index c1066df..3141cb5 100644 > > --- a/block/dmg.c > > +++ b/block/dmg.c > > @@ -51,9 +51,16 @@ typedef struct BDRVDMGState { > > > > static int dmg_probe(const uint8_t *buf, int buf_size, const char *filename) > > { > > - int len=strlen(filename); > > - if(len>4 && !strcmp(filename+len-4,".dmg")) > > Someone really didn't like whitespace :) Glad to see it rewritten to > keep the patch checker happy. Actually I don't think it would have complained, because it would be context only. But I simply can't leave this code alone while touching the function. :-) Kevin