From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNnDG-0003ej-Ik for qemu-devel@nongnu.org; Mon, 15 Oct 2012 12:08:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TNnDF-00014N-DS for qemu-devel@nongnu.org; Mon, 15 Oct 2012 12:08:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNnDF-00014D-6N for qemu-devel@nongnu.org; Mon, 15 Oct 2012 12:08:17 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9FG8FK2011972 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 15 Oct 2012 12:08:16 -0400 Message-ID: <507C34EC.9020507@redhat.com> Date: Mon, 15 Oct 2012 18:08:12 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1348675011-8794-1-git-send-email-pbonzini@redhat.com> <1348675011-8794-24-git-send-email-pbonzini@redhat.com> In-Reply-To: <1348675011-8794-24-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 23/45] block: export dirty bitmap information in query-block List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: jcody@redhat.com, qemu-devel@nongnu.org Am 26.09.2012 17:56, schrieb Paolo Bonzini: > Signed-off-by: Paolo Bonzini > --- > v1->v2: new > > block.c | 6 ++++++ > qapi-schema.json | 20 ++++++++++++++++++-- > 2 file modificati, 24 inserzioni(+), 2 rimozioni(-) > > diff --git a/block.c b/block.c > index 2c1273c..074325d 100644 > --- a/block.c > +++ b/block.c > @@ -2697,6 +2697,12 @@ BlockInfo *bdrv_query_info(BlockDriverState *bs) > info->io_status = bs->iostatus; > } > > + if (bs->dirty_bitmap) { > + info->has_dirty = true; > + info->dirty = g_malloc0(sizeof(*info->dirty)); > + info->dirty->count = bdrv_get_dirty_count(bs) * BDRV_SECTORS_PER_DIRTY_CHUNK; > + } > + > if (bs->drv) { > info->has_inserted = true; > info->inserted = g_malloc0(sizeof(*info->inserted)); > diff --git a/qapi-schema.json b/qapi-schema.json > index 26ac21f..dd418b8 100644 > --- a/qapi-schema.json > +++ b/qapi-schema.json > @@ -604,7 +604,7 @@ > '*backing_file': 'str', 'backing_file_depth': 'int', > 'encrypted': 'bool', 'encryption_key_missing': 'bool', > 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int', > - 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int'} } > + 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int' } } > > ## > # @BlockDeviceIoStatus: > @@ -622,6 +622,18 @@ > { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] } > > ## > +# @BlockDirtyInfo: > +# > +# Block dirty bitmap information. > +# > +# @count: number of dirty sectors according to the dirty bitmap > +# > +# Since: 1.3 > +## > +{ 'type': 'BlockDirtyInfo', > + 'data': {'count': 'int'} } Can we use bytes instead of arbitrary units of 512 bytes? I don't want to discuss with people why a sector is 512 bytes here even though all their virtual disks use a 4k sector size... Kevin