All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] qemu-img check: Distinguish different kinds of errors
Date: Tue, 06 Jul 2010 13:01:32 +0200	[thread overview]
Message-ID: <4C330D0C.9050900@redhat.com> (raw)
In-Reply-To: <87vd8shoib.wl%morita.kazutaka@lab.ntt.co.jp>

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

  reply	other threads:[~2010-07-06 11:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-02 17:14 [Qemu-devel] [PATCH 0/2] Improve qemu-img check output Kevin Wolf
2010-07-02 17:14 ` [Qemu-devel] [PATCH 1/2] qemu-img check: Distinguish different kinds of errors Kevin Wolf
2010-07-06 10:51   ` MORITA Kazutaka
2010-07-06 11:01     ` Kevin Wolf [this message]
2010-07-06 11:03   ` [Qemu-devel] [PATCH v2 " Kevin Wolf
2010-07-02 17:15 ` [Qemu-devel] [PATCH 2/2] qcow2/vdi: Change check to distinguish error cases Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C330D0C.9050900@redhat.com \
    --to=kwolf@redhat.com \
    --cc=morita.kazutaka@lab.ntt.co.jp \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.