From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuiAX-0008UD-4A for qemu-devel@nongnu.org; Mon, 14 Jan 2013 06:25:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TuiAT-0005hX-9A for qemu-devel@nongnu.org; Mon, 14 Jan 2013 06:25:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55927) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuiAT-0005hQ-1y for qemu-devel@nongnu.org; Mon, 14 Jan 2013 06:25:29 -0500 Message-ID: <1358162708.22120.8.camel@localhost> From: Pavel Hrdina Date: Mon, 14 Jan 2013 12:25:08 +0100 In-Reply-To: <1358147387-8221-5-git-send-email-xiawenc@linux.vnet.ibm.com> References: <1358147387-8221-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1358147387-8221-5-git-send-email-xiawenc@linux.vnet.ibm.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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: Wenchao Xia Cc: aliguori@us.ibm.com, stefanha@gmail.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, pbonzini@redhat.com, armbru@redhat.com 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); > > elem = g_new0(ImageInfoList, 1); > elem->value = info;