From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuwOx-0005db-HV for qemu-devel@nongnu.org; Mon, 14 Jan 2013 21:37:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TuwOw-0004zI-Eh for qemu-devel@nongnu.org; Mon, 14 Jan 2013 21:37:23 -0500 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:52740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuwOv-0004z6-Rz for qemu-devel@nongnu.org; Mon, 14 Jan 2013 21:37:22 -0500 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 15 Jan 2013 08:05:45 +0530 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 5A0A7394004C for ; Tue, 15 Jan 2013 08:07:16 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r0F2bAHT4653450 for ; Tue, 15 Jan 2013 08:07:14 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r0F2bB9v006714 for ; Tue, 15 Jan 2013 02:37:11 GMT Message-ID: <50F4C0D5.8050804@linux.vnet.ibm.com> Date: Tue, 15 Jan 2013 10:37:09 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1358147387-8221-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1358147387-8221-5-git-send-email-xiawenc@linux.vnet.ibm.com> <1358162708.22120.8.camel@localhost> In-Reply-To: <1358162708.22120.8.camel@localhost> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V3 04/11] qemu-img: switch image retrieving function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Hrdina Cc: aliguori@us.ibm.com, stefanha@gmail.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, pbonzini@redhat.com, armbru@redhat.com 于 2013-1-14 19:25, Pavel Hrdina 写道: > On Mon, 2013-01-14 at 15:09 +0800, Wenchao Xia wrote: >> Now qemu-img call block layer function to get image info. >> >> Signed-off-by: Wenchao Xia >> Reviewed-by: Eric Blake >> --- >> qemu-img.c | 86 +---------------------------------------------------------- >> 1 files changed, 2 insertions(+), 84 deletions(-) >> >> diff --git a/qemu-img.c b/qemu-img.c >> index 9dab48f..e20551a 100644 >> --- a/qemu-img.c >> +++ b/qemu-img.c >> @@ -1338,6 +1257,7 @@ static ImageInfoList *collect_image_info_list(const char *filename, >> ImageInfoList *head = NULL; >> ImageInfoList **last = &head; >> GHashTable *filenames; >> + Error *err = NULL; >> >> filenames = g_hash_table_new_full(g_str_hash, str_equal_func, NULL, NULL); >> >> @@ -1359,9 +1279,7 @@ static ImageInfoList *collect_image_info_list(const char *filename, >> goto err; >> } >> >> - info = g_new0(ImageInfo, 1); >> - collect_image_info(bs, info, filename); >> - collect_snapshots(bs, info); >> + info = bdrv_query_image_info(bs, &err); > > You are not using the 'err' variable so you should pass 'NULL' instead. > > info = bdrv_query_image_info(bs, NULL); > OK. >> >> elem = g_new0(ImageInfoList, 1); >> elem->value = info; > > -- Best Regards Wenchao Xia