qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 4/5] sheepdog: use inet_connect to simplify c


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v4 4/5] sheepdog: use inet_connect to simplify connect code
Date: Tue, 29 Jan 2013 10:11:44 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

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 <address@hidden>
> ---
>  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

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