[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 17/33] qcow2: Prepare count_contiguous_clusters() for
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 17/33] qcow2: Prepare count_contiguous_clusters() for external data file |
Date: |
Fri, 8 Mar 2019 13:58:07 +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] [PULL 07/33] tests/multiboot: Improve portability by searching bash in the $PATH, (continued)
- [Qemu-block] [PULL 07/33] tests/multiboot: Improve portability by searching bash in the $PATH, Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 06/33] iotests: check whitelisted formats, Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 13/33] qcow2: Extend spec for external data files, Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 08/33] tests/bios-tables: Improve portability by searching bash in the $PATH, Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 11/33] qemu-iotests: Test qcow2 preallocation modes, Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 10/33] qemu-iotests: Ensure GNU sed is used, Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 12/33] qcow2: Simplify preallocation code, Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 09/33] qemu-iotests: Improve portability by searching bash in the $PATH, Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 14/33] qcow2: Basic definitions for external data files, Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 18/33] qcow2: Don't assume 0 is an invalid cluster offset, Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 17/33] qcow2: Prepare count_contiguous_clusters() for external data file,
Kevin Wolf <=
- [Qemu-block] [PULL 19/33] qcow2: Return 0/-errno in qcow2_alloc_compressed_cluster_offset(), Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 20/33] qcow2: Prepare qcow2_co_block_status() for data file, Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 21/33] qcow2: External file I/O, Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 15/33] qcow2: Pass bs to qcow2_get_cluster_type(), Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 16/33] qcow2: Prepare qcow2_get_cluster_type() for external data file, Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 24/33] qcow2: Add basic data-file infrastructure, Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 22/33] qcow2: Return error for snapshot operation with data file, Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 23/33] qcow2: Support external data file in qemu-img check, Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 25/33] qcow2: Creating images with external data file, Kevin Wolf, 2019/03/08
- [Qemu-block] [PULL 28/33] qemu-iotests: Preallocation with external data file, Kevin Wolf, 2019/03/08