|
|
9ae3a8 |
From 2d939b5a9f5717aba21727f635c6da898123ad5b Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Max Reitz <mreitz@redhat.com>
|
|
|
9ae3a8 |
Date: Fri, 2 May 2014 16:06:20 +0200
|
|
|
9ae3a8 |
Subject: [PATCH 02/31] qcow2: Free preallocated zero clusters
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Max Reitz <mreitz@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1399046781-16359-2-git-send-email-mreitz@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 58644
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.0 qemu-kvm PATCH 1/2] qcow2: Free preallocated zero clusters
|
|
|
9ae3a8 |
Bugzilla: 1052093
|
|
|
9ae3a8 |
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
BZ: 1052093
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
In qcow2_free_any_clusters, preallocated zero clusters should be freed
|
|
|
9ae3a8 |
just as normal clusters are.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Max Reitz <mreitz@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit 8f730dd24edd2576ecbd596de7ea4361296b129c)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Max Reitz <mreitz@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
block/qcow2-refcount.c | 8 +++++---
|
|
|
9ae3a8 |
1 file changed, 5 insertions(+), 3 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
block/qcow2-refcount.c | 8 +++++---
|
|
|
9ae3a8 |
1 files changed, 5 insertions(+), 3 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
|
|
|
9ae3a8 |
index 73ae4e3..429b01c 100644
|
|
|
9ae3a8 |
--- a/block/qcow2-refcount.c
|
|
|
9ae3a8 |
+++ b/block/qcow2-refcount.c
|
|
|
9ae3a8 |
@@ -811,11 +811,13 @@ void qcow2_free_any_clusters(BlockDriverState *bs, uint64_t l2_entry,
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
break;
|
|
|
9ae3a8 |
case QCOW2_CLUSTER_NORMAL:
|
|
|
9ae3a8 |
- qcow2_free_clusters(bs, l2_entry & L2E_OFFSET_MASK,
|
|
|
9ae3a8 |
- nb_clusters << s->cluster_bits, type);
|
|
|
9ae3a8 |
+ case QCOW2_CLUSTER_ZERO:
|
|
|
9ae3a8 |
+ if (l2_entry & L2E_OFFSET_MASK) {
|
|
|
9ae3a8 |
+ qcow2_free_clusters(bs, l2_entry & L2E_OFFSET_MASK,
|
|
|
9ae3a8 |
+ nb_clusters << s->cluster_bits, type);
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
break;
|
|
|
9ae3a8 |
case QCOW2_CLUSTER_UNALLOCATED:
|
|
|
9ae3a8 |
- case QCOW2_CLUSTER_ZERO:
|
|
|
9ae3a8 |
break;
|
|
|
9ae3a8 |
default:
|
|
|
9ae3a8 |
abort();
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|