At Tue, 29 Jan 2013 10:11:44 -0700, Eric Blake wrote: > > 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
In such case, uri->server already contains the IPv6 address enclosed in brackets, so we don't need to enclose it here. Thanks, Kazutaka