[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/3] qemu-nbd: Improve error reporting
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 3/3] qemu-nbd: Improve error reporting |
Date: |
Mon, 29 Mar 2010 13:03:01 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Thunderbird/3.0.3 |
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.
Kevin