Received: from eggs.gnu.org ([208.118.235.92]:54275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQDoa-0001GV-CD for qemu-devel@nongnu.org; Thu, 11 Apr 2013 05:29:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQDoV-0007cZ-I8 for qemu-devel@nongnu.org; Thu, 11 Apr 2013 05:29:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQDoV-0007aW-Ai for qemu-devel@nongnu.org; Thu, 11 Apr 2013 05:29:03 -0400 From: Markus Armbruster References: <1364903250-10429-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1364903250-10429-11-git-send-email-xiawenc@linux.vnet.ibm.com> <871uaixtd1.fsf@blackfin.pond.sub.org> <516652CB.2010902@linux.vnet.ibm.com> Date: Thu, 11 Apr 2013 11:28:58 +0200 In-Reply-To: <516652CB.2010902@linux.vnet.ibm.com> (Wenchao Xia's message of "Thu, 11 Apr 2013 14:06:03 +0800") Message-ID: <87obdlju05.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH V11 10/17] qmp: add recursive member in ImageInfo List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, stefanha@gmail.com, lcapitulino@redhat.com, qemu-devel@nongnu.org, pbonzini@redhat.com Wenchao Xia writes: > =E4=BA=8E 2013-4-11 0:06, Markus Armbruster =E5=86=99=E9=81=93: >> Wenchao Xia writes: >>=20 >>> New member *backing-image is added to reflect the backing chain >>> status. >>> >>> Signed-off-by: Wenchao Xia >>> Reviewed-by: Kevin Wolf >>> Reviewed-by: Eric Blake >>> --- >>> block/qapi.c | 6 +++++- >>> qapi-schema.json | 5 ++++- >>> 2 files changed, 9 insertions(+), 2 deletions(-) >>> >>> diff --git a/block/qapi.c b/block/qapi.c >>> index 5e91ab8..fa61c85 100644 >>> --- a/block/qapi.c >>> +++ b/block/qapi.c >>> @@ -123,7 +123,11 @@ int bdrv_query_snapshot_info_list(BlockDriverState= *bs, >>> return 0; >>> } >>>=20=20=20 >>> -/* return 0 on success, and @p_info will be set only on success. */ >>> +/* >>> + * return 0 on success, and @p_info will be set only on success, >>> + * (*pinfo)->has_backing_image will be false and (*pinfo)->backing_ima= ge will >>> + * be NULL. >>> + */ >>=20 >> Sounds like this function computes incomplete ImageInfo. Correct? If >> yes, why? >>=20 > yes, qemu-img will use it to get info of an image that may be broken > in backing file chain(can't get backing file's info). Ah, that makes sense. Suggest: /** * bdrv_query_image_info: * @bs: block device to examine * @p_info: location to store image information * @errp: location to store error information * * Store "flat" image inforation in @p_info. * * "Flat" means it does *not* query backing image information, * i.e. (*pinfo)->has_backing_image will be set to false and * (*pinfo)->backing_image to NULL even when the image does in fact have * a backing image. * * On error, store error in @errp. * * Returns: 0 on success, -errno on error. */ >>> int bdrv_query_image_info(BlockDriverState *bs, >>> ImageInfo **p_info, >>> Error **errp) >>> diff --git a/qapi-schema.json b/qapi-schema.json >>> index 225afef..ad9dd82 100644 >>> --- a/qapi-schema.json >>> +++ b/qapi-schema.json >>> @@ -233,6 +233,8 @@ >>> # >>> # @snapshots: #optional list of VM snapshots >>> # >>> +# @backing-image: #optional info of the backing image (since 1.5) >>> +# >>> # Since: 1.3 >>> # >>> ## >>> @@ -242,7 +244,8 @@ >>> '*actual-size': 'int', 'virtual-size': 'int', >>> '*cluster-size': 'int', '*encrypted': 'bool', >>> '*backing-filename': 'str', '*full-backing-filename': 'str= ', >>> - '*backing-filename-format': 'str', '*snapshots': ['Snapshot= Info'] } } >>> + '*backing-filename-format': 'str', '*snapshots': ['Snapshot= Info'], >>> + '*backing-image': 'ImageInfo' } } >>>=20=20=20 >>> ## >>> # @ImageCheck: >>=20