From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Svst1-0005Gb-Mw for qemu-devel@nongnu.org; Mon, 30 Jul 2012 12:32:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Svssx-0003hV-Dt for qemu-devel@nongnu.org; Mon, 30 Jul 2012 12:32:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60945) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Svssx-0003fD-5s for qemu-devel@nongnu.org; Mon, 30 Jul 2012 12:31:59 -0400 Date: Mon, 30 Jul 2012 13:32:29 -0300 From: Luiz Capitulino Message-ID: <20120730133229.5b43f402@doriath.home> In-Reply-To: <1343308701-29632-3-git-send-email-benoit@irqsave.net> References: <1343308701-29632-1-git-send-email-benoit@irqsave.net> <1343308701-29632-3-git-send-email-benoit@irqsave.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH V5 2/4] block: Use bdrv_get_backing_file_depth() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: benoit.canet@gmail.com Cc: kwolf@redhat.com, =?ISO-8859-1?B?QmVub+50?= Canet , qemu-devel@nongnu.org, pbonzini@redhat.com, eblake@redhat.com, stefanha@linux.vnet.ibm.com On Thu, 26 Jul 2012 15:18:19 +0200 benoit.canet@gmail.com wrote: > From: Beno=EEt Canet >=20 > Use the dedicated counting function in qmp_query_block in order to > propagate the backing file depth to HMP. >=20 > Signed-off-by: Benoit Canet > --- > block.c | 3 +++ > qapi-schema.json | 9 ++++++--- > 2 files changed, 9 insertions(+), 3 deletions(-) >=20 > diff --git a/block.c b/block.c > index 22ebe49..a6fba1d 100644 > --- a/block.c > +++ b/block.c > @@ -2450,6 +2450,9 @@ BlockInfoList *qmp_query_block(Error **errp) > info->value->inserted->backing_file =3D g_strdup(bs->bac= king_file); > } > =20 > + info->value->inserted->backing_file_depth =3D > + bdrv_get_backing_file_depth(bs); > + > if (bs->io_limits_enabled) { > info->value->inserted->bps =3D > bs->io_limits.bps[BLOCK_IO_LIMIT_TOTAL]; > diff --git a/qapi-schema.json b/qapi-schema.json > index a92adb1..2b50f22 100644 > --- a/qapi-schema.json > +++ b/qapi-schema.json > @@ -398,6 +398,8 @@ > # > # @backing_file: #optional the name of the backing file (for copy-on-wri= te) > # > +# @backing_file_depth: number of files in the backing file chain (since:= 1.2) > +# > # @encrypted: true if the backing device is encrypted > # > # @bps: total throughput limit in bytes per second is specified > @@ -418,9 +420,10 @@ > ## > { 'type': 'BlockDeviceInfo', > 'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str', > - '*backing_file': 'str', 'encrypted': 'bool', > - 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int', > - 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int'} } > + '*backing_file': 'str', 'backing-file-depth': 'int', Should use underscores, ie. should be backing_file_depth. Also, the next patch and this can be squashed together. Otherwise series looks good to me now. > + 'encrypted': 'bool', 'bps': 'int', 'bps_rd': 'int', > + 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', > + 'iops_wr': 'int'} } > =20 > ## > # @BlockDeviceIoStatus: