qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH] sheepdog: add support for connecting to unix domain socket
Date: Wed, 16 Jan 2013 15:21:09 +0100	[thread overview]
Message-ID: <20130116142109.GA9300@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1358259160-7815-1-git-send-email-morita.kazutaka@lab.ntt.co.jp>

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:<vdiname>''
> -
> -``sheepdog:<vdiname>:<snapid>''
> -
> -``sheepdog:<vdiname>:<tag>''
> -
> -``sheepdog:<host>:<port>:<vdiname>''
> -
> -``sheepdog:<host>:<port>:<vdiname>:<snapid>''
> +using TCP:
> +@example
> +sheepdog:[<hostname>:<port>:]<vdiname>[:<snapid or tag>]
> +@end example
>  
> -``sheepdog:<host>:<port>:<vdiname>:<tag>''
> +using Unix Domain Socket:
> +@example
> +sheepdog:unix:<domain-socket>:<vdiname>[:<snapid or tag>]
> +@end example

Please document that <domain-socket> must be an absolute path.  This
will prevent confusing users who try a relative path.

Stefan

  reply	other threads:[~2013-01-16 14:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-15 14:12 [Qemu-devel] [PATCH] sheepdog: add support for connecting to unix domain socket MORITA Kazutaka
2013-01-16 14:21 ` Stefan Hajnoczi [this message]
2013-01-19 15:13   ` MORITA Kazutaka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130116142109.GA9300@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=morita.kazutaka@lab.ntt.co.jp \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).