Re: [Qemu-devel] [RFC V1 10/14] qapi: Add support for deduplication infos in qapi-schema.json.

2013-01-17 Thread Benoît Canet
 +# @running:   True if deduplication is running

Internally QCOW2 deduplication state switch between STOPPED, STARTING, RUNNING
and STOPPING.

Should the running field be a status field reflecting all theses states in a
string for example ?
Or is the boolean ok ?

Regards

Benoît



Re: [Qemu-devel] [RFC V1 10/14] qapi: Add support for deduplication infos in qapi-schema.json.

2013-01-17 Thread Eric Blake
On 01/17/2013 05:15 AM, Benoît Canet wrote:
 +# @running:   True if deduplication is running
 
 Internally QCOW2 deduplication state switch between STOPPED, STARTING, RUNNING
 and STOPPING.
 
 Should the running field be a status field reflecting all theses states in a
 string for example ?
 Or is the boolean ok ?

Outputting an enum of all four states may be the best for debugging
purposes.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature


Re: [Qemu-devel] [RFC V1 10/14] qapi: Add support for deduplication infos in qapi-schema.json.

2013-01-16 Thread Eric Blake
On 01/16/2013 09:25 AM, Benoît Canet wrote:
 ---
  qapi-schema.json |   40 +++-
  1 file changed, 39 insertions(+), 1 deletion(-)
 

 +#
 +# @deleted-clusters:  Number of deleted cluster when refcount  0

Is it really when refcount goes negative, or when it reaches zero?
Overall it seems nice.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature


[Qemu-devel] [RFC V1 10/14] qapi: Add support for deduplication infos in qapi-schema.json.

2013-01-16 Thread Benoît Canet
---
 qapi-schema.json |   40 +++-
 1 file changed, 39 insertions(+), 1 deletion(-)

diff --git a/qapi-schema.json b/qapi-schema.json
index 5dfa052..1a5014c 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -720,6 +720,40 @@
 { 'command': 'query-block', 'returns': ['BlockInfo'] }
 
 ##
+# @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
+#
+# @running:   True if deduplication is running
+#
+# 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',
+   'running': 'bool' } }
+
+##
 # @BlockDeviceStats:
 #
 # Statistics of a virtual block device or a block backing device.
@@ -747,13 +781,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:
-- 
1.7.10.4