aboutsummaryrefslogtreecommitdiff
path: root/block/vdi.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2010-07-06 10:48:01 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2010-07-06 10:48:01 -0500
commit5efb397f877fc3002c8bc764f4656f4761bd965d (patch)
tree4ef1809f16a7f30f237840cdbfc5521afd4e8316 /block/vdi.c
parentfb787f81e749fde8c74548f9db1472eb321b9a0c (diff)
parent33b1db1c8888b77e06c720ebef0482ed598eb384 (diff)
Merge remote branch 'kwolf/for-anthony' into staging
Diffstat (limited to 'block/vdi.c')
-rw-r--r--block/vdi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/block/vdi.c b/block/vdi.c
index ee8cc7b1aa..f72633cf19 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -291,11 +291,10 @@ static void vdi_header_print(VdiHeader *header)
}
#endif
-static int vdi_check(BlockDriverState *bs)
+static int vdi_check(BlockDriverState *bs, BdrvCheckResult *res)
{
/* TODO: additional checks possible. */
BDRVVdiState *s = (BDRVVdiState *)bs->opaque;
- int n_errors = 0;
uint32_t blocks_allocated = 0;
uint32_t block;
uint32_t *bmap;
@@ -315,11 +314,12 @@ static int vdi_check(BlockDriverState *bs)
} else {
fprintf(stderr, "ERROR: block index %" PRIu32
" also used by %" PRIu32 "\n", bmap[bmap_entry], bmap_entry);
+ res->corruptions++;
}
} else {
fprintf(stderr, "ERROR: block index %" PRIu32
" too large, is %" PRIu32 "\n", block, bmap_entry);
- n_errors++;
+ res->corruptions++;
}
}
}
@@ -327,12 +327,12 @@ static int vdi_check(BlockDriverState *bs)
fprintf(stderr, "ERROR: allocated blocks mismatch, is %" PRIu32
", should be %" PRIu32 "\n",
blocks_allocated, s->header.blocks_allocated);
- n_errors++;
+ res->corruptions++;
}
qemu_free(bmap);
- return n_errors;
+ return 0;
}
static int vdi_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)