From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMwkV-00051M-J3 for qemu-devel@nongnu.org; Tue, 02 Apr 2013 04:39:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UMwkU-00031w-Kk for qemu-devel@nongnu.org; Tue, 02 Apr 2013 04:39:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43314) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMwkU-00031r-C3 for qemu-devel@nongnu.org; Tue, 02 Apr 2013 04:39:22 -0400 Date: Tue, 2 Apr 2013 10:09:07 +0200 From: Kevin Wolf Message-ID: <20130402080906.GC2341@dhcp-200-207.str.redhat.com> References: <1363961953-13561-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1363961953-13561-12-git-send-email-xiawenc@linux.vnet.ibm.com> <20130328095412.GA3077@dhcp-200-207.str.redhat.com> <5154FE04.5020506@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5154FE04.5020506@linux.vnet.ibm.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH V10 11/17] qmp: add ImageInfo in BlockDeviceInfo used by query-block 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 Am 29.03.2013 um 03:35 hat Wenchao Xia geschrieben: > =E4=BA=8E 2013-3-28 17:54, Kevin Wolf =E5=86=99=E9=81=93: > >Am 22.03.2013 um 15:19 hat Wenchao Xia geschrieben: > >> Now image info will be retrieved as an embbed json object inside > >>BlockDeviceInfo, backing chain info and all related internal snapshot > >>info can be got in the enhanced recursive structure of ImageInfo. > >> > >>Signed-off-by: Wenchao Xia > >>--- > >> block/qapi.c | 39 ++++++++++++++++++++++++++-- > >> include/block/qapi.h | 4 ++- > >> qapi-schema.json | 5 +++- > >> qmp-commands.hx | 67 +++++++++++++++++++++++++++++++++++++++= ++++++++++- > >> 4 files changed, 109 insertions(+), 6 deletions(-) > >> > >>diff --git a/block/qapi.c b/block/qapi.c > >>index df73f5b..9051947 100644 > >>--- a/block/qapi.c > >>+++ b/block/qapi.c > >>@@ -200,9 +200,15 @@ int bdrv_query_image_info(BlockDriverState *bs, > >> return 0; > >> } > >> > >>-BlockInfo *bdrv_query_info(BlockDriverState *bs) > >>+/* return 0 on success, and @p_info will be set only on success. */ > >>+int bdrv_query_info(BlockDriverState *bs, > >>+ BlockInfo **p_info, > >>+ Error **errp) > >> { > >> BlockInfo *info =3D g_malloc0(sizeof(*info)); > >>+ BlockDriverState *bs0; > >>+ ImageInfo **p_image_info; > >>+ int ret =3D 0; > > > >ret is never changed, so this function always returns 0. I would sugge= st > >to drop ret and make the function return type void. > > > My bad, I forgot to set its value, the interface is intend to return > negative error number and errp both on fail. Why do you need two separate error reporting mechanisms? Shouldn't only errp be enough? Kevin