Message ID | 87vd8shoib.wl%morita.kazutaka@lab.ntt.co.jp |
---|---|
State | New |
Headers | show |
Am 06.07.2010 12:51, schrieb MORITA Kazutaka: > At Fri, 2 Jul 2010 19:14:59 +0200, > Kevin Wolf wrote: >> >> People think that their images are corrupted when in fact there are just some >> leaked clusters. Differentiating several error cases should make the messages >> more comprehensible. >> >> Signed-off-by: Kevin Wolf <kwolf@redhat.com> >> --- >> block.c | 10 ++++++-- >> block.h | 10 ++++++++- >> qemu-img.c | 62 +++++++++++++++++++++++++++++++++++++++++++++-------------- >> 3 files changed, 63 insertions(+), 19 deletions(-) >> @@ -453,28 +462,51 @@ static int img_check(int argc, char **argv) >> if (!bs) { >> return 1; >> } >> - ret = bdrv_check(bs); >> - switch(ret) { >> - case 0: >> - printf("No errors were found on the image.\n"); >> - break; >> - case -ENOTSUP: >> + ret = bdrv_check(bs, &result); >> + >> + if (ret == -ENOTSUP) { >> error("This image format does not support checks"); >> - break; >> - default: >> - if (ret < 0) { >> - error("An error occurred during the check"); >> - } else { >> - printf("%d errors were found on the image.\n", ret); >> + return 1; > > Is it okay to call bdrv_delete(bs) before return? It is necessary for > the sheepdog driver to pass qemu-iotests. > > Kazutaka Yes, you're right. Thanks for catching this, I'll send a new version. Kevin
--- a/qemu-img.c +++ b/qemu-img.c @@ -466,6 +466,7 @@ static int img_check(int argc, char **argv) if (ret == -ENOTSUP) { error("This image format does not support checks"); + bdrv_delete(bs); return 1; }