On 01/29/2013 01:56 AM, MORITA Kazutaka wrote:
> This uses the form "<host>:<port>" for the representation of the
> sheepdog server to use inet_connect.
> 
> Signed-off-by: MORITA Kazutaka <morita.kazut...@lab.ntt.co.jp>
> ---
>  block/sheepdog.c |  111 ++++++++++++++---------------------------------------
>  1 files changed, 30 insertions(+), 81 deletions(-)
> 

>      /* sheepdog[+tcp]://[host:port]/vdiname */
> -    s->addr = g_strdup(uri->server ?: SD_DEFAULT_ADDR);
> -    if (uri->port) {
> -        s->port = g_strdup_printf("%d", uri->port);
> -    } else {
> -        s->port = g_strdup(SD_DEFAULT_PORT);
> -    }
> +    s->host_spec = g_strdup_printf("%s:%d", uri->server ?: SD_DEFAULT_ADDR,
> +                                   uri->port ?: SD_DEFAULT_PORT);

Is this going to properly handle IPv6 addresses, which need to use
brackets around the host portion, as in:
 sheepdog+tcp://[::1]:port/vdiname

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to