Permalink
Browse files

Merge pull request #20 from andreil/master

CA-90801
  • Loading branch information...
2 parents 6fc1f96 + f6be386 commit 9960138790b9d3610b12acd153bba20235efa4f5 @andreil andreil committed Nov 12, 2012
Showing with 15 additions and 1 deletion.
  1. +15 −1 vhd/lib/vhd-util-check.c
@@ -55,6 +55,7 @@ struct vhd_util_check_options {
char ignore_parent_uuid;
char ignore_timestamps;
char check_data;
+ char no_check_bat;
char collect_stats;
};
@@ -826,6 +827,9 @@ vhd_util_check_bat(struct vhd_util_check_ctx *ctx, vhd_context_t *vhd)
}
}
+ if (ctx->opts.no_check_bat)
+ continue;
+
for (j = 0; j < vhd_blks; j++) {
uint32_t joff = vhd->bat.bat[j];
@@ -1203,7 +1207,7 @@ vhd_util_check(int argc, char **argv)
vhd_util_check_stats_init(&ctx);
optind = 0;
- while ((c = getopt(argc, argv, "n:iItpbsh")) != -1) {
+ while ((c = getopt(argc, argv, "n:iItpbBsh")) != -1) {
switch (c) {
case 'n':
name = optarg;
@@ -1223,6 +1227,9 @@ vhd_util_check(int argc, char **argv)
case 'b':
ctx.opts.check_data = 1;
break;
+ case 'B':
+ ctx.opts.no_check_bat = 1;
+ break;
case 's':
ctx.opts.collect_stats = 1;
break;
@@ -1240,6 +1247,12 @@ vhd_util_check(int argc, char **argv)
goto usage;
}
+ if ((ctx.opts.collect_stats || ctx.opts.check_data) &&
+ ctx.opts.no_check_bat) {
+ err = -EINVAL;
+ goto usage;
+ }
+
err = vhd_util_check_vhd(&ctx, name);
if (err)
goto out;
@@ -1258,6 +1271,7 @@ vhd_util_check(int argc, char **argv)
usage:
printf("options: -n <file> [-i ignore missing primary footers] "
"[-I ignore parent uuids] [-t ignore timestamps] "
+ "[-B do not check BAT for overlapping (precludes -s, -b)] "
"[-p check parents] [-b check bitmaps] [-s stats] [-h help]\n");
return err;
}

0 comments on commit 9960138

Please sign in to comment.