[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] sheepdog: Set error when connection fails
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH] sheepdog: Set error when connection fails |
Date: |
Fri, 21 Apr 2017 08:19:32 +0800 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
On Thu, 04/20 22:32, Kevin Wolf wrote:
> Am 20.04.2017 um 17:30 hat Daniel P. Berrange geschrieben:
> > On Thu, Apr 20, 2017 at 12:00:03PM +0800, Fam Zheng wrote:
> > > Signed-off-by: Fam Zheng <address@hidden>
> > > ---
> > > block/sheepdog.c | 1 +
> > > 1 file changed, 1 insertion(+)
> > >
> > > diff --git a/block/sheepdog.c b/block/sheepdog.c
> > > index fb9203e..7e889ee 100644
> > > --- a/block/sheepdog.c
> > > +++ b/block/sheepdog.c
> > > @@ -608,6 +608,7 @@ static int connect_to_sdog(BDRVSheepdogState *s,
> > > Error **errp)
> > > qemu_set_nonblock(fd);
> > > } else {
> > > fd = -EIO;
> > > + error_setg(errp, "Failed to connect to sheepdog server");
> > > }
> >
> > This doesn't make much sense to me. The lines just above the
> > diff context have this:
> >
> > fd = socket_connect(s->addr, errp, NULL, NULL);
Oops! :(
> >
> > socket_connect should have already reported an error on "errp"
> > in the scenario that 'fd == -1'.
>
> By the way, am I the only one who thinks that having errp anywhere else
> than as the last argument is bad style? I can easily see myself missing
> that this functions sets it because the last argument is NULL.
Hmm, exactly.. Socket code does this here and there, and it's hard to read.
Fam
- [Qemu-devel] [PATCH] sheepdog: Set error when connection fails, Fam Zheng, 2017/04/20
- Re: [Qemu-devel] [PATCH] sheepdog: Set error when connection fails, Philippe Mathieu-Daudé, 2017/04/20
- Re: [Qemu-devel] [PATCH] sheepdog: Set error when connection fails, Jeff Cody, 2017/04/20
- Re: [Qemu-devel] [PATCH] sheepdog: Set error when connection fails, Jeff Cody, 2017/04/20
- Re: [Qemu-devel] [PATCH] sheepdog: Set error when connection fails, Daniel P. Berrange, 2017/04/20
- Re: [Qemu-devel] [PATCH] sheepdog: Set error when connection fails, Jeff Cody, 2017/04/20
- Re: [Qemu-devel] [PATCH] sheepdog: Set error when connection fails, Kevin Wolf, 2017/04/20
- Re: [Qemu-devel] [PATCH] sheepdog: Set error when connection fails, Jeff Cody, 2017/04/20
- Re: [Qemu-devel] [PATCH] sheepdog: Set error when connection fails,
Fam Zheng <=
- Re: [Qemu-devel] [PATCH] sheepdog: Set error when connection fails, Markus Armbruster, 2017/04/21
- Re: [Qemu-devel] [PATCH] sheepdog: Set error when connection fails, Daniel P. Berrange, 2017/04/21
- Re: [Qemu-devel] [PATCH] sheepdog: Set error when connection fails, Fam Zheng, 2017/04/21
- Re: [Qemu-devel] [PATCH] sheepdog: Set error when connection fails, Daniel P. Berrange, 2017/04/21