From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Twa76-0003Ec-Op for qemu-devel@nongnu.org; Sat, 19 Jan 2013 10:13:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Twa75-0001Bv-Cz for qemu-devel@nongnu.org; Sat, 19 Jan 2013 10:13:44 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:44662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Twa75-0001AW-6L for qemu-devel@nongnu.org; Sat, 19 Jan 2013 10:13:43 -0500 Received: by mail-pa0-f41.google.com with SMTP id bj3so2634831pad.14 for ; Sat, 19 Jan 2013 07:13:42 -0800 (PST) Date: Sun, 20 Jan 2013 00:13:38 +0900 Message-ID: From: MORITA Kazutaka In-Reply-To: <20130116142109.GA9300@stefanha-thinkpad.redhat.com> References: <1358259160-7815-1-git-send-email-morita.kazutaka@lab.ntt.co.jp> <20130116142109.GA9300@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Qemu-devel] [PATCH] sheepdog: add support for connecting to unix domain socket List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, stefanha@redhat.com, qemu-devel@nongnu.org, MORITA Kazutaka At Wed, 16 Jan 2013 15:21:09 +0100, Stefan Hajnoczi wrote: > > On Tue, Jan 15, 2013 at 11:12:40PM +0900, MORITA Kazutaka wrote: > > +static int set_nodelay(int fd) > > +{ > > + int opt = 1; > > + return setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *)&opt, sizeof(opt)); > > +} > > + > > Please split this into a separate patch that moves the function to > util/osdep.c and names it socket_set_nodelay(). You can put it below > socket_set_cork(). Agreed. > > > @@ -804,23 +781,14 @@ static int set_nodelay(int fd) > > */ > > static int get_sheep_fd(BDRVSheepdogState *s) > > { > > - int ret, fd; > > + int fd; > > > > - fd = connect_to_sdog(s->addr, s->port); > > + fd = connect_to_sdog(s->host_spec); > > The patch would be easier to review if you split out a separate patch to > move from addr/port to host_spec. Then the final patch can focus just > on UNIX domain sockets without all the addr/port to host_spec changes. Agreed. > > > if (fd < 0) { > > error_report("%s", strerror(errno)); > > connect_to_sdog() does not set errno and it already reports errors > internally. Can this error_report() be dropped? Yes, I'll remove it. > > > return fd; > > } > > > > - socket_set_nonblock(fd); > > Where is nonblock being set now that you've removed this? Oops, I thought that unix_connect and inet_connect return nonblocking sockets, but it was wrong. > > > > -``sheepdog::::'' > > +using Unix Domain Socket: > > +@example > > +sheepdog:unix::[:] > > +@end example > > Please document that must be an absolute path. This > will prevent confusing users who try a relative path. Okay. Thanks for your comments, I'll send v2. Kazutaka