[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v2 23/26] qcow2: Restrict qcow2_co_pwrite_zeroes() to full cl
From: |
Alberto Garcia |
Subject: |
[RFC PATCH v2 23/26] qcow2: Restrict qcow2_co_pwrite_zeroes() to full clusters only |
Date: |
Sun, 27 Oct 2019 00:25:25 +0300 |
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>
---
block/qcow2.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/block/qcow2.c b/block/qcow2.c
index 01322ca449..537569ce88 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -3704,6 +3704,12 @@ static coroutine_fn int
qcow2_co_pwrite_zeroes(BlockDriverState *bs,
bytes = s->cluster_size;
nr = s->cluster_size;
ret = qcow2_get_cluster_offset(bs, offset, &nr, &off);
+ /* TODO: allow zeroing separate subclusters, we only allow
+ * zeroing full clusters at the moment. */
+ if (nr != bytes) {
+ qemu_co_mutex_unlock(&s->lock);
+ return -ENOTSUP;
+ }
if (ret != QCOW2_CLUSTER_UNALLOCATED &&
ret != QCOW2_CLUSTER_UNALLOCATED_SUBCLUSTER &&
ret != QCOW2_CLUSTER_ZERO_PLAIN &&
--
2.20.1
- [RFC PATCH v2 22/26] qcow2: Add subcluster support to handle_alloc_space(), (continued)
- [RFC PATCH v2 22/26] qcow2: Add subcluster support to handle_alloc_space(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 05/26] qcow2: Document the Extended L2 Entries feature, Alberto Garcia, 2019/10/26
- [RFC PATCH v2 14/26] qcow2: Add subcluster support to qcow2_get_cluster_offset(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 20/26] qcow2: Update L2 bitmap in qcow2_alloc_cluster_link_l2(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 19/26] qcow2: Fix offset calculation in handle_dependencies(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 18/26] qcow2: Add subcluster support to expand_zero_clusters_in_l1(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 07/26] qcow2: Add subcluster-related fields to BDRVQcow2State, Alberto Garcia, 2019/10/26
- [RFC PATCH v2 12/26] qcow2: Handle QCOW2_CLUSTER_UNALLOCATED_SUBCLUSTER, Alberto Garcia, 2019/10/26
- [RFC PATCH v2 23/26] qcow2: Restrict qcow2_co_pwrite_zeroes() to full clusters only,
Alberto Garcia <=
- [RFC PATCH v2 09/26] qcow2: Add l2_entry_size(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 11/26] qcow2: Add qcow2_get_subcluster_type(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 15/26] qcow2: Add subcluster support to zero_in_l2_slice(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 17/26] qcow2: Add subcluster support to check_refcounts_l2(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 03/26] qcow2: Process QCOW2_CLUSTER_ZERO_ALLOC clusters in handle_copied(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 02/26] qcow2: Split cluster_needs_cow() out of count_cow_clusters(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 04/26] qcow2: Add get_l2_entry() and set_l2_entry(), Alberto Garcia, 2019/10/26