[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 12/61] qcow2: Free preallocated zero clusters
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 12/61] qcow2: Free preallocated zero clusters |
Date: |
Fri, 11 Oct 2013 17:05:02 +0200 |
From: Max Reitz <address@hidden>
In qcow2_free_any_clusters, preallocated zero clusters should be freed
just as normal clusters are.
Signed-off-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qcow2-refcount.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 4cb9c23..4ef6899 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -796,11 +796,13 @@ void qcow2_free_any_clusters(BlockDriverState *bs,
uint64_t l2_entry,
}
break;
case QCOW2_CLUSTER_NORMAL:
- qcow2_free_clusters(bs, l2_entry & L2E_OFFSET_MASK,
- nb_clusters << s->cluster_bits, type);
+ case QCOW2_CLUSTER_ZERO:
+ if (l2_entry & L2E_OFFSET_MASK) {
+ qcow2_free_clusters(bs, l2_entry & L2E_OFFSET_MASK,
+ nb_clusters << s->cluster_bits, type);
+ }
break;
case QCOW2_CLUSTER_UNALLOCATED:
- case QCOW2_CLUSTER_ZERO:
break;
default:
abort();
--
1.8.1.4
- [Qemu-devel] [PULL 02/61] qapi: Introduce enum BlockJobType, (continued)
- [Qemu-devel] [PULL 02/61] qapi: Introduce enum BlockJobType, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 03/61] qapi: make use of new BlockJobType, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 04/61] qapi: Add ImageInfoSpecific type, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 05/61] block: Add bdrv_get_specific_info, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 06/61] block/qapi: Human-readable ImageInfoSpecific dump, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 07/61] qcow2: Add support for ImageInfoSpecific, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 09/61] qemu-iotests: Additional info from qemu-img info, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 10/61] qcow2: Alignment of snapshot table entries, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 08/61] qemu-iotests: Discard specific info in _img_info, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 11/61] qcow2: Use pread for inactive L1 in overlap check, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 12/61] qcow2: Free preallocated zero clusters,
Kevin Wolf <=
- [Qemu-devel] [PULL 13/61] qcow2: Always use error path on writing snapshots, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 14/61] qcow2: Free allocated snapshot table on error, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 16/61] block/get_block_status: avoid redundant callouts on raw devices, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 17/61] block: Add BlockDriver.bdrv_check_ext_snapshot., Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 15/61] qcow2: Assert against snapshot name/ID overflow, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 18/61] qemu-iotests: Discard preallocated zero clusters, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 19/61] ahci: set ahci mode on reset, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 21/61] qcow2: Add missing space in error message, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 20/61] block: qemu-iotests for vhdx, read sample dynamic image, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 22/61] qcow2: Remove wrong metadata overlap check, Kevin Wolf, 2013/10/11