From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvTrh-0003DO-V1 for qemu-devel@nongnu.org; Wed, 16 Jan 2013 09:21:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvTrd-0006f8-5z for qemu-devel@nongnu.org; Wed, 16 Jan 2013 09:21:17 -0500 Received: from mail-wg0-f49.google.com ([74.125.82.49]:40340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvTrc-0006f2-WD for qemu-devel@nongnu.org; Wed, 16 Jan 2013 09:21:13 -0500 Received: by mail-wg0-f49.google.com with SMTP id 15so930464wgd.16 for ; Wed, 16 Jan 2013 06:21:12 -0800 (PST) Date: Wed, 16 Jan 2013 15:21:09 +0100 From: Stefan Hajnoczi Message-ID: <20130116142109.GA9300@stefanha-thinkpad.redhat.com> References: <1358259160-7815-1-git-send-email-morita.kazutaka@lab.ntt.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1358259160-7815-1-git-send-email-morita.kazutaka@lab.ntt.co.jp> 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: MORITA Kazutaka Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com 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(). > @@ -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. > 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? > return fd; > } > > - socket_set_nonblock(fd); Where is nonblock being set now that you've removed this? > diff --git a/qemu-options.hx b/qemu-options.hx > index 9df0cde..cbd2d4b 100644 > --- a/qemu-options.hx > +++ b/qemu-options.hx > @@ -2059,17 +2059,15 @@ devices. > > Syntax for specifying a sheepdog device > @table @list > -``sheepdog:'' > - > -``sheepdog::'' > - > -``sheepdog::'' > - > -``sheepdog:::'' > - > -``sheepdog::::'' > +using TCP: > +@example > +sheepdog:[::][:] > +@end example > > -``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. Stefan