Patchwork [RFC,V2,12/16] qapi: Add support for deduplication infos in qapi-schema.json.

login
register
mail settings
Submitter Benoît Canet
Date Feb. 6, 2013, 12:32 p.m.
Message ID <1360153939-9563-13-git-send-email-benoit@irqsave.net>
Download mbox | patch
Permalink /patch/218696/
State New
Headers show

Comments

Benoît Canet - Feb. 6, 2013, 12:32 p.m.
---
 qapi-schema.json |   40 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)
Eric Blake - Feb. 7, 2013, 3:42 p.m.
On 02/06/2013 05:32 AM, Benoît Canet wrote:
> ---
>  qapi-schema.json |   40 +++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 39 insertions(+), 1 deletion(-)
> 
> diff --git a/qapi-schema.json b/qapi-schema.json
> index cf4e9d6..ec61f6a 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -814,6 +814,40 @@
>                                     'stopping' ] }
>  
>  ##
> +# @BlockDeviceDedupInfo
> +#
> +# Statistics of the deduplication on a virtual block device implementing it
> +# since QEMU startup.

Ambiguous - is it the block implementing dedup since qemu startup, or
statistics collected since qemu startup?  I think it is fine to shorten
to just:

Statistics about block device deduplication.

> +#
> +# @deduplicated-clusters:     Number of clusters which where deduplicated.
> +#
> +# @non-deduplicated-clusters: Number of clusters which where not deduplicated.

That's long; would it be any better calling it:

@unique-clusters: Number of clusters found to be unique.

Patch

diff --git a/qapi-schema.json b/qapi-schema.json
index cf4e9d6..ec61f6a 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -814,6 +814,40 @@ 
                                    'stopping' ] }
 
 ##
+# @BlockDeviceDedupInfo
+#
+# Statistics of the deduplication on a virtual block device implementing it
+# since QEMU startup.
+#
+# @deduplicated-clusters:     Number of clusters which where deduplicated.
+#
+# @non-deduplicated-clusters: Number of clusters which where not deduplicated.
+#
+# @missing-data-reads:        Number of reads which where done to complete
+#                             unaligned or sub cluster sized writes.
+#
+# @ram-hash-creations:        Number of cluster hash created in RAM.
+#
+# @ram-hash-deletions:        Number of cluster hash deleted in RAM.
+#
+# @ram-usage:                 Number of bytes of RAM used.
+#
+# @deleted-clusters:          Number of deleted cluster when refcount == 0
+#
+# @refcount-overflows:        Number of refcount overflows
+#
+# @status:                    Status of the deduplication
+#
+# Since: 1.5.0
+##
+{ 'type': 'BlockDeviceDedupInfo',
+  'data': {'deduplicated-clusters': 'int', 'non-deduplicated-clusters': 'int',
+           'missing-data-reads': 'int', 'ram-hash-creations': 'int',
+           'ram-hash-deletions': 'int', 'ram-usage': 'int',
+           'deleted-clusters': 'int', 'refcount-overflows': 'int',
+           'status': 'DedupStatus' } }
+
+##
 # @BlockDeviceStats:
 #
 # Statistics of a virtual block device or a block backing device.
@@ -841,13 +875,17 @@ 
 #                     growable sparse files (like qcow2) that are used on top
 #                     of a physical device.
 #
+# @deduplication: #optional @BlockDeviceDedupInfo describing deduplication
+#                           metrics (since 1.5)
+#
 # Since: 0.14.0
 ##
 { 'type': 'BlockDeviceStats',
   'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
            'wr_operations': 'int', 'flush_operations': 'int',
            'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
-           'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
+           'rd_total_time_ns': 'int', 'wr_highest_offset': 'int',
+           '*deduplication': 'BlockDeviceDedupInfo' } }
 
 ##
 # @BlockStats: