qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] sheepdog: add support for connecting to unix do


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] sheepdog: add support for connecting to unix domain socket
Date: Wed, 16 Jan 2013 15:21:09 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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

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

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]