qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/3] qemu-nbd: Improve error reporting


From: Ryota Ozaki
Subject: Re: [Qemu-devel] [PATCH 3/3] qemu-nbd: Improve error reporting
Date: Mon, 3 May 2010 06:52:11 +0900

On Mon, Mar 29, 2010 at 8:03 PM, Kevin Wolf <address@hidden> wrote:
> Am 28.03.2010 19:07, schrieb Ryota Ozaki:
>> - use err(3) instead of errx(3) if errno is available
>>   to report why failed
>> - let fail prior to daemon(3) if opening a nbd file
>>   is likely to fail after daemonizing to avoid silent
>>   failure exit
>> - add missing 'ret = 1' when unix_socket_outgoing failed
>>
>> Signed-off-by: Ryota Ozaki <address@hidden>
>
> Acked-by: Kevin Wolf <address@hidden>
>
>> @@ -343,25 +343,31 @@ int main(int argc, char **argv)
>>          return 1;
>>      }
>>
>> -    if (bdrv_open(bs, argv[optind], flags) < 0) {
>> -        return 1;
>> +    if ((ret = bdrv_open(bs, argv[optind], flags)) < 0) {
>> +        errno = -ret;
>> +        err(EXIT_FAILURE, "Failed to bdrv_open '%s'", argv[optind]);
>>      }
>
> If you do it like this, you could do the change for even more errors,
> like the ones returned by bdrv_read. But that doesn't make this patch
> less correct, of course.

Indeed. So I will include the changes for bdrv_read as well
in the next round.

Thanks,
  ozaki-r

>
> Kevin
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]