[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 26/30] qcow2: Restrict qcow2_co_pwrite_zeroes() to full cluste
From: |
Alberto Garcia |
Subject: |
[PATCH v4 26/30] qcow2: Restrict qcow2_co_pwrite_zeroes() to full clusters only |
Date: |
Tue, 17 Mar 2020 19:16:23 +0100 |
Ideally it should be possible to zero individual subclusters using
this function, but this is currently not implemented.
Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
block/qcow2.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index ad230ed1b1..d406ef355b 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -3743,7 +3743,9 @@ static coroutine_fn int
qcow2_co_pwrite_zeroes(BlockDriverState *bs,
bytes = s->cluster_size;
nr = s->cluster_size;
ret = qcow2_get_host_offset(bs, offset, &nr, &off, &type);
- if (ret < 0 ||
+ /* TODO: allow zeroing separate subclusters, we only allow
+ * zeroing full clusters at the moment. */
+ if (ret < 0 || nr != bytes ||
(type != QCOW2_SUBCLUSTER_UNALLOCATED_PLAIN &&
type != QCOW2_SUBCLUSTER_UNALLOCATED_ALLOC &&
type != QCOW2_SUBCLUSTER_ZERO_PLAIN &&
--
2.20.1
- [PATCH v4 14/30] qcow2: Add cluster type parameter to qcow2_get_host_offset(), (continued)
- [PATCH v4 14/30] qcow2: Add cluster type parameter to qcow2_get_host_offset(), Alberto Garcia, 2020/03/17
- [PATCH v4 08/30] qcow2: Add dummy has_subclusters() function, Alberto Garcia, 2020/03/17
- [PATCH v4 20/30] qcow2: Add subcluster support to discard_in_l2_slice(), Alberto Garcia, 2020/03/17
- [PATCH v4 19/30] qcow2: Add subcluster support to zero_in_l2_slice(), Alberto Garcia, 2020/03/17
- [PATCH v4 24/30] qcow2: Clear the L2 bitmap when allocating a compressed cluster, Alberto Garcia, 2020/03/17
- [PATCH v4 03/30] qcow2: Add calculate_l2_meta(), Alberto Garcia, 2020/03/17
- [PATCH v4 13/30] qcow2: Add QCow2SubclusterType and qcow2_get_subcluster_type(), Alberto Garcia, 2020/03/17
- [PATCH v4 17/30] qcow2: Add subcluster support to calculate_l2_meta(), Alberto Garcia, 2020/03/17
- [PATCH v4 01/30] qcow2: Make Qcow2AioTask store the full host offset, Alberto Garcia, 2020/03/17
- [PATCH v4 26/30] qcow2: Restrict qcow2_co_pwrite_zeroes() to full clusters only,
Alberto Garcia <=
- [PATCH v4 27/30] qcow2: Assert that expand_zero_clusters_in_l1() does not support subclusters, Alberto Garcia, 2020/03/17
- [PATCH v4 07/30] qcow2: Document the Extended L2 Entries feature, Alberto Garcia, 2020/03/17
- [PATCH v4 30/30] iotests: Add tests for qcow2 images with extended L2 entries, Alberto Garcia, 2020/03/17
- [PATCH v4 28/30] qcow2: Add the 'extended_l2' option and the QCOW2_INCOMPAT_EXTL2 bit, Alberto Garcia, 2020/03/17