[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC V2 02/16] qcow2: Enable the deduplication feature.
From: |
Benoît Canet |
Subject: |
[Qemu-devel] [RFC V2 02/16] qcow2: Enable the deduplication feature. |
Date: |
Wed, 6 Feb 2013 13:32:05 +0100 |
---
block/qcow2.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/block/qcow2.c b/block/qcow2.c
index 9097e64..514811a 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -540,6 +540,13 @@ static int qcow2_open(BlockDriverState *bs, int flags)
}
}
+ if (s->incompatible_features & QCOW2_INCOMPAT_DEDUP) {
+ ret = qcow2_dedup_init(bs);
+ if (ret < 0) {
+ goto fail;
+ }
+ }
+
#ifdef DEBUG_ALLOC
{
BdrvCheckResult result = {0};
@@ -1009,8 +1016,13 @@ fail:
static void qcow2_close(BlockDriverState *bs)
{
BDRVQcowState *s = bs->opaque;
+
g_free(s->l1_table);
+ if (s->has_dedup) {
+ qcow2_dedup_close(bs);
+ }
+
qcow2_cache_flush(bs, s->l2_table_cache);
qcow2_cache_flush(bs, s->refcount_block_cache);
@@ -1500,6 +1512,12 @@ static int qcow2_create2(const char *filename, int64_t
total_size,
if (ret < 0) {
goto out;
}
+
+ /* minimal init */
+ ret = qcow2_dedup_init(bs);
+ if (ret < 0) {
+ goto out;
+ }
}
/* Want a backing file? There you go.*/
--
1.7.10.4
- [Qemu-devel] [RFC V2 01/16] qcow2: Add qcow2_co_dedup_resume to restart deduplication., (continued)
- [Qemu-devel] [RFC V2 01/16] qcow2: Add qcow2_co_dedup_resume to restart deduplication., Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V2 03/16] qcow2: Add deduplication metrics structures., Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V2 05/16] qcow2: Collect unaligned writes missing data reads metric., Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V2 06/16] qcow2: Collect deduplicated cluster metric., Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V2 14/16] qcow2: Add qcow2_dedup_update_metrics to compute dedup RAM usage., Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V2 15/16] qcow2: returns deduplication metrics and status via bdrv_get_info(), Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V2 10/16] qcow2: Count cluster deleted metric, Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V2 11/16] qcow2: Count deduplication refcount overflow metric., Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V2 07/16] qcow2: Collect undeduplicated cluster metric., Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V2 02/16] qcow2: Enable the deduplication feature.,
Benoît Canet <=
- [Qemu-devel] [RFC V2 04/16] qcow2: Initialize deduplication metrics., Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V2 08/16] qcow2: Count QCowHashNode creation metrics., Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V2 09/16] qcow2: Count QCowHashNode removal from tree for metrics., Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V2 16/16] qapi: Return virtual block device deduplication metrics in QMP, Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V2 12/16] qapi: Add support for deduplication infos in qapi-schema.json., Benoît Canet, 2013/02/06
- [Qemu-devel] [RFC V2 13/16] block: Add deduplication metrics to BlockDriverInfo., Benoît Canet, 2013/02/06