[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] qemu-img check: Distinguish different kinds
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] qemu-img check: Distinguish different kinds of errors |
Date: |
Tue, 06 Jul 2010 13:01:32 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-2.fc12 Thunderbird/3.0.4 |
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 <address@hidden>
>> ---
>> 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