aboutsummaryrefslogtreecommitdiff
path: root/block/qed-check.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2010-12-17 15:58:22 +0000
committerKevin Wolf <kwolf@redhat.com>2011-04-13 12:06:41 +0200
commit21df65b6444858ddee3a86d8666571bb41695614 (patch)
tree142793b8ae8e6fef8b1aa412cf39e2340091fdf9 /block/qed-check.c
parentd54f10bba7635b5ad8b750afd2bb2f0f8eb68b45 (diff)
downloadqemu-21df65b6444858ddee3a86d8666571bb41695614.zip
qemu-21df65b6444858ddee3a86d8666571bb41695614.tar.gz
qemu-21df65b6444858ddee3a86d8666571bb41695614.tar.bz2
qed: Add support for zero clusters
Zero clusters are similar to unallocated clusters except instead of reading their value from a backing file when one is available, the cluster is always read as zero. This implements read support only. At this stage, QED will never write a zero cluster. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qed-check.c')
-rw-r--r--block/qed-check.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block/qed-check.c b/block/qed-check.c
index 4600932..ea4ebc8 100644
--- a/block/qed-check.c
+++ b/block/qed-check.c
@@ -72,7 +72,8 @@ static unsigned int qed_check_l2_table(QEDCheck *check, QEDTable *table)
for (i = 0; i < s->table_nelems; i++) {
uint64_t offset = table->offsets[i];
- if (!offset) {
+ if (qed_offset_is_unalloc_cluster(offset) ||
+ qed_offset_is_zero_cluster(offset)) {
continue;
}
@@ -111,7 +112,7 @@ static int qed_check_l1_table(QEDCheck *check, QEDTable *table)
unsigned int num_invalid_l2;
uint64_t offset = table->offsets[i];
- if (!offset) {
+ if (qed_offset_is_unalloc_cluster(offset)) {
continue;
}