From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuofF-0001gd-7N for qemu-devel@nongnu.org; Mon, 14 Jan 2013 13:21:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TuofA-0008GS-U7 for qemu-devel@nongnu.org; Mon, 14 Jan 2013 13:21:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuofA-0008GK-Lh for qemu-devel@nongnu.org; Mon, 14 Jan 2013 13:21:36 -0500 Date: Mon, 14 Jan 2013 16:21:37 -0200 From: Luiz Capitulino Message-ID: <20130114162137.73f479c5@doriath.home> In-Reply-To: <1358162708.22120.8.camel@localhost> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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: Pavel Hrdina Cc: aliguori@us.ibm.com, stefanha@gmail.com, armbru@redhat.com, qemu-devel@nongnu.org, pbonzini@redhat.com, Wenchao Xia On Mon, 14 Jan 2013 12:25:08 +0100 Pavel Hrdina wrote: > 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. Actually, it's necessary to check for the error. > > info = bdrv_query_image_info(bs, NULL); > > > > > elem = g_new0(ImageInfoList, 1); > > elem->value = info; > >