From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULuyN-0008D5-Uq for qemu-devel@nongnu.org; Sat, 30 Mar 2013 08:33:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULuyJ-0006b9-O8 for qemu-devel@nongnu.org; Sat, 30 Mar 2013 08:33:27 -0400 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:37244) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULuyJ-0006ad-3Y for qemu-devel@nongnu.org; Sat, 30 Mar 2013 08:33:23 -0400 Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 30 Mar 2013 17:59:38 +0530 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id F0FA83940053 for ; Sat, 30 Mar 2013 18:03:13 +0530 (IST) Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2UCX9l361276202 for ; Sat, 30 Mar 2013 18:03:10 +0530 Received: from d28av05.in.ibm.com (loopback [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r2UCXCHa013099 for ; Sat, 30 Mar 2013 23:33:12 +1100 Message-ID: <5156DB47.4050109@linux.vnet.ibm.com> Date: Sat, 30 Mar 2013 20:32:07 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1363961953-13561-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1363961953-13561-9-git-send-email-xiawenc@linux.vnet.ibm.com> <5155F51F.4050704@redhat.com> In-Reply-To: <5155F51F.4050704@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V10 08/17] block: move qmp_query_block() and bdrv_query_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, lcapitulino@redhat.com 于 2013-3-30 4:10, Eric Blake 写道: > On 03/22/2013 08:19 AM, Wenchao Xia wrote: >> This is a code move patch, except in qmp_query_block bdrv_next(bs) >> is used instead of direct traverse of global array 'bdrv_states'. > > Mixing code motion and a code change isn't always the best, but at least > you were honest about it. I don't know how easy it would be to split > this into two patches for straight code motion. > It can't be split since build fail with original code, bdrv_states is a static global variable in block.c. >> This patch also fix code style error reported by check script. >> >> Signed-off-by: Wenchao Xia >> --- >> block.c | 76 ------------------------------------------------ >> block/qapi.c | 77 +++++++++++++++++++++++++++++++++++++++++++++++++ >> include/block/block.h | 1 - >> include/block/qapi.h | 1 + >> 4 files changed, 78 insertions(+), 77 deletions(-) > > At any rate, > > Reviewed-by: Eric Blake > >> -BlockInfoList *qmp_query_block(Error **errp) >> -{ >> - BlockInfoList *head = NULL, **p_next = &head; >> - BlockDriverState *bs; >> - >> - QTAILQ_FOREACH(bs, &bdrv_states, list) { > >> +BlockInfoList *qmp_query_block(Error **errp) >> +{ >> + BlockInfoList *head = NULL, **p_next = &head; >> + BlockDriverState *bs = NULL; >> + >> + while ((bs = bdrv_next(bs))) { > > This is the tweak you made. > -- Best Regards Wenchao Xia