[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH 07/20] qcow2: Prepare count_contiguous_clusters() fo
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PATCH 07/20] qcow2: Prepare count_contiguous_clusters() for external data file |
Date: |
Wed, 27 Feb 2019 18:22:43 +0100 |
Offset 0 can be valid for normal (allocated) clusters now, so use
qcow2_get_cluster_type() instead.
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qcow2-cluster.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 9cc8f0f3e4..660161bf00 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -389,12 +389,12 @@ static int count_contiguous_clusters(BlockDriverState
*bs, int nb_clusters,
uint64_t first_entry = be64_to_cpu(l2_slice[0]);
uint64_t offset = first_entry & mask;
- if (!offset) {
+ first_cluster_type = qcow2_get_cluster_type(bs, first_entry);
+ if (first_cluster_type == QCOW2_CLUSTER_UNALLOCATED) {
return 0;
}
/* must be allocated */
- first_cluster_type = qcow2_get_cluster_type(bs, first_entry);
assert(first_cluster_type == QCOW2_CLUSTER_NORMAL ||
first_cluster_type == QCOW2_CLUSTER_ZERO_ALLOC);
--
2.20.1
- [Qemu-block] [PATCH 00/20] qcow2: External data files, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 01/20] qemu-iotests: Test qcow2 preallocation modes, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 05/20] qcow2: Pass bs to qcow2_get_cluster_type(), Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 03/20] qcow2: Extend spec for external data files, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 06/20] qcow2: Prepare qcow2_get_cluster_type() for external data file, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 13/20] qcow2: Support external data file in qemu-img check, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 14/20] qcow2: Add basic data-file infrastructure, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 02/20] qcow2: Simplify preallocation code, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 09/20] qcow2: Return 0/-errno in qcow2_alloc_compressed_cluster_offset(), Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 18/20] qemu-iotests: Preallocation with external data file, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 07/20] qcow2: Prepare count_contiguous_clusters() for external data file,
Kevin Wolf <=
- [Qemu-block] [PATCH 10/20] qcow2: Prepare qcow2_co_block_status() for data file, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 08/20] qcow2: Don't assume 0 is an invalid cluster offset, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 20/20] qemu-iotests: amend with external data file, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 04/20] qcow2: Basic definitions for external data files, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 12/20] qcow2: Return error for snapshot operation with data file, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 15/20] qcow2: Creating images with external data file, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 16/20] qcow2: Store data file name in the image, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 11/20] qcow2: External file I/O, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 17/20] qcow2: Implement data-file-raw create option, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 19/20] qemu-iotests: General tests for qcow2 with external data file, Kevin Wolf, 2019/02/27