From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tw1EY-0003S5-0l for qemu-devel@nongnu.org; Thu, 17 Jan 2013 20:59:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tw1EW-0002WX-Ng for qemu-devel@nongnu.org; Thu, 17 Jan 2013 20:59:05 -0500 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:35595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tw1EU-0002PL-Bl for qemu-devel@nongnu.org; Thu, 17 Jan 2013 20:59:04 -0500 Received: from /spool/local by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 18 Jan 2013 11:53:47 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id C3B2A3578053 for ; Fri, 18 Jan 2013 12:58:49 +1100 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r0I1kxDX62980278 for ; Fri, 18 Jan 2013 12:47:00 +1100 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r0I1wmwQ015299 for ; Fri, 18 Jan 2013 12:58:48 +1100 Message-ID: <50F8AC0D.9040108@linux.vnet.ibm.com> Date: Fri, 18 Jan 2013 09:57:33 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1358408410-22187-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1358408410-22187-5-git-send-email-xiawenc@linux.vnet.ibm.com> <50F872DF.20607@redhat.com> In-Reply-To: <50F872DF.20607@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V4 04/13] block: add snapshot info query function bdrv_query_snapshot_infolist() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: aliguori@us.ibm.com, phrdina@redhat.com, stefanha@gmail.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, pbonzini@redhat.com, armbru@redhat.com 于 2013-1-18 5:53, Eric Blake 写道: > On 01/17/2013 12:40 AM, Wenchao Xia wrote: >> This patch add function bdrv_query_snapshot_infolist(), which will >> return snapshot info of an image in qmp object format. The implementation >> code are mostly copied from qemu-img.c with modification to fit more >> for qmp based block layer API. >> To help filter out snapshot info not needed, a call back function is >> added in bdrv_query_snapshot_infolist(). >> bdrv_can_read_snapshot() should be called before call this function, >> to avoid got *errp set unexpectly. > > s/unexpectly/unexpectedly/ > sorry for it. >> >> Signed-off-by: Wenchao Xia >> Reviewed-by: Eric Blake >> --- >> block.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ >> include/block/block.h | 7 +++++++ >> 2 files changed, 53 insertions(+), 0 deletions(-) >> > >> +SnapshotInfoList *bdrv_query_snapshot_infolist(BlockDriverState *bs, >> + SnapshotFilterFunc filter, >> + void *opaque, >> + Error **errp) >> +{ >> + int i, sn_count; >> + QEMUSnapshotInfo *sn_tab = NULL; >> + SnapshotInfoList *info_list, *cur_item = NULL, *head = NULL; >> + >> + sn_count = bdrv_snapshot_list(bs, &sn_tab); >> + if (sn_count < 0) { >> + /* Fix me: set errp in bdrv_snapshot_list() instead of here */ > > You didn't remove this fixme anywhere in the series; it would be better > to respin things to avoid a net gain of fixmes. > yep, but solving that may need more work focusing on the function enhancement and caller behavior which already exist, not quite related to this serial. This serial is a bit long already, I'd like a standalone patch for it later. >> + error_setg(errp, "bdrv_snapshot_list: error %d\n", sn_count); >> + return NULL; >> + } > -- Best Regards Wenchao Xia