From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEBHP-00042H-4h for qemu-devel@nongnu.org; Fri, 08 Mar 2013 23:21:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UEBHD-0006oT-NE for qemu-devel@nongnu.org; Fri, 08 Mar 2013 23:21:07 -0500 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:59751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEBHD-0006oE-3g for qemu-devel@nongnu.org; Fri, 08 Mar 2013 23:20:55 -0500 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 9 Mar 2013 09:47:29 +0530 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id DD4D1394002D for ; Sat, 9 Mar 2013 09:50:48 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r294KiaR32440322 for ; Sat, 9 Mar 2013 09:50:44 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r294KmcV023343 for ; Sat, 9 Mar 2013 15:20:48 +1100 Message-ID: <513AB89B.4000800@linux.vnet.ibm.com> Date: Sat, 09 Mar 2013 12:20:43 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1362636445-7188-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1362636445-7188-7-git-send-email-xiawenc@linux.vnet.ibm.com> <513A6074.1070006@redhat.com> In-Reply-To: <513A6074.1070006@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V8 06/20] block: move collect_snapshots() and collect_image_info() to block/qapi.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@gmail.com, qemu-devel@nongnu.org, armbru@redhat.com, pbonzini@redhat.com 于 2013-3-9 6:04, Eric Blake 写道: > On 03/06/2013 11:07 PM, Wenchao Xia wrote: >> This patch is just for making review easier, those two functions will >> be modified and renamed later. >> >> Signed-off-by: Wenchao Xia >> --- > >> + >> +void bdrv_collect_image_info(BlockDriverState *bs, >> + ImageInfo *info, >> + const char *fmt) >> +{ > > Three arguments here... > >> + >> +void bdrv_collect_snapshots(BlockDriverState *bs , ImageInfo *info); >> +void bdrv_collect_image_info(BlockDriverState *bs, >> + ImageInfo *info, >> + const char *filename, >> + const char *fmt); > > ...but four here... > >> >> -static void collect_image_info(BlockDriverState *bs, >> - ImageInfo *info, >> - const char *filename) > > ...and moved from three arguments here... > >> info = g_new0(ImageInfo, 1); >> - collect_image_info(bs, info, filename); >> - collect_snapshots(bs, info); >> + bdrv_collect_image_info(bs, info, filename, fmt); > > ...and your call site changes from 3 to 4 arguments. > > How did you compile this? Code motion must NOT make any semantic > changes - you should have exactly three arguments, preferably with the > same name, and save the addition of a fourth fmt argument until a later > patch. > > Hint - a code motion patch should be easy to inspect with: > $ diff -u <(sed -n 's/^-//p' patch) <(sed -n 's/^\+//p' patch) > > It's okay to have differences (such as 'static void collect_image_info' > becoming exported 'void bdrv_collect_image_info', and to see > reindentation to line up to the new function name), but the differences > should be trivially correct, and not a change between number of parameters. > My bad, I was dizzy in rebasing the patches, will correct it. -- Best Regards Wenchao Xia