From patchwork Sat Apr 13 08:56:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wayne Xia X-Patchwork-Id: 236323 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6AED42C009F for ; Sat, 13 Apr 2013 19:36:13 +1000 (EST) Received: from localhost ([::1]:35384 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQwOG-00072Y-MN for incoming@patchwork.ozlabs.org; Sat, 13 Apr 2013 05:04:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQwJu-0000fF-5S for qemu-devel@nongnu.org; Sat, 13 Apr 2013 05:00:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQwJt-0000p7-A2 for qemu-devel@nongnu.org; Sat, 13 Apr 2013 05:00:26 -0400 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:60989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQwJs-0000oq-ON for qemu-devel@nongnu.org; Sat, 13 Apr 2013 05:00:25 -0400 Received: from /spool/local by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 13 Apr 2013 18:48:59 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp04.au.ibm.com (202.81.31.210) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 13 Apr 2013 18:48:57 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id B4CBB2BB0052 for ; Sat, 13 Apr 2013 19:00:20 +1000 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r3D8knZ36750612 for ; Sat, 13 Apr 2013 18:46:49 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r3D90J7T028717 for ; Sat, 13 Apr 2013 19:00:20 +1000 Received: from RH63Wenchao (wenchaox.cn.ibm.com [9.115.122.157]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r3D8u24O020091; Sat, 13 Apr 2013 19:00:18 +1000 From: Wenchao Xia To: qemu-devel@nongnu.org Date: Sat, 13 Apr 2013 16:56:40 +0800 Message-Id: <1365843407-16504-12-git-send-email-xiawenc@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1365843407-16504-1-git-send-email-xiawenc@linux.vnet.ibm.com> References: <1365843407-16504-1-git-send-email-xiawenc@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13041308-9264-0000-0000-000003824341 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 202.81.31.146 Cc: kwolf@redhat.com, phrdina@redhat.com, stefanha@gmail.com, armbru@redhat.com, lcapitulino@redhat.com, pbonzini@redhat.com, Wenchao Xia Subject: [Qemu-devel] [PATCH V12 11/18] qmp: add recursive member in ImageInfo X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org New member *backing-image is added to reflect the backing chain status. Signed-off-by: Wenchao Xia --- block/qapi.c | 18 +++++++++++++++++- qapi-schema.json | 5 ++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/block/qapi.c b/block/qapi.c index 13c7860..2f33a05 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -135,7 +135,23 @@ int bdrv_query_snapshot_info_list(BlockDriverState *bs, return 0; } -/* return 0 on success, and @p_info will be set only on success. */ +/** + * 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 16d0b1f..955ff05 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': ['SnapshotInfo'] } } + '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'], + '*backing-image': 'ImageInfo' } } ## # @ImageCheck: