From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6O0P-00014m-VR for qemu-devel@nongnu.org; Thu, 23 Jan 2014 12:23:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W6O0K-0004l0-38 for qemu-devel@nongnu.org; Thu, 23 Jan 2014 12:23:53 -0500 Received: from paradis.irqsave.net ([62.212.105.220]:48158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6O0J-0004kq-OZ for qemu-devel@nongnu.org; Thu, 23 Jan 2014 12:23:47 -0500 Date: Thu, 23 Jan 2014 18:23:47 +0100 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140123172346.GF3519@irqsave.net> References: <1390442606-31320-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1390442606-31320-1-git-send-email-famz@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2] qapi: Add "backing" to BlockStats List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com Le Thursday 23 Jan 2014 =E0 10:03:26 (+0800), Fam Zheng a =E9crit : > Currently there is no way to query BlockStats of the backing chain. Thi= s > adds "backing" field into BlockStats to make it possible. >=20 > The comment of "parent" is reworded. >=20 > Signed-off-by: Fam Zheng >=20 > --- > v2: Only add "backing", drop "file". >=20 > Signed-off-by: Fam Zheng > --- > block/qapi.c | 5 +++++ > qapi-schema.json | 10 ++++++---- > 2 files changed, 11 insertions(+), 4 deletions(-) >=20 > diff --git a/block/qapi.c b/block/qapi.c > index a32cb79..98b1b83 100644 > --- a/block/qapi.c > +++ b/block/qapi.c > @@ -318,6 +318,11 @@ BlockStats *bdrv_query_stats(const BlockDriverStat= e *bs) > s->parent =3D bdrv_query_stats(bs->file); > } > =20 > + if (bs->backing_hd) { > + s->has_backing =3D true; > + s->backing =3D bdrv_query_stats(bs->backing_hd); > + } > + > return s; > } > =20 > diff --git a/qapi-schema.json b/qapi-schema.json > index f27c48a..0e534d0 100644 > --- a/qapi-schema.json > +++ b/qapi-schema.json > @@ -1022,15 +1022,17 @@ > # > # @stats: A @BlockDeviceStats for the device. > # > -# @parent: #optional This may point to the backing block device if thi= s is a > -# a virtual block device. If it's a backing block, this will= point > -# to the backing file is one is present. > +# @parent: #optional This describes the file block device if it has on= e. > +# > +# @backing: #optional This describes the backing block device if it ha= s one. > +# (Since 2.0) > # > # Since: 0.14.0 > ## > { 'type': 'BlockStats', > 'data': {'*device': 'str', 'stats': 'BlockDeviceStats', > - '*parent': 'BlockStats'} } > + '*parent': 'BlockStats', > + '*backing': 'BlockStats'} } > =20 > ## > # @query-blockstats: > --=20 > 1.8.5.3 >=20 >=20 Reviewed-by: Benoit Canet