[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: |
MORITA Kazutaka |
Subject: |
Re: [Qemu-devel] [PATCH v4 4/5] sheepdog: use inet_connect to simplify connect code |
Date: |
Wed, 30 Jan 2013 14:02:16 +0900 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) Emacs/23.2 Mule/6.0 (HANACHIRUSATO) |
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 <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
In such case, uri->server already contains the IPv6 address enclosed
in brackets, so we don't need to enclose it here.
Thanks,
Kazutaka
- [Qemu-devel] [PATCH v4 0/5] sheepdog: unix domain socket support, MORITA Kazutaka, 2013/01/29
- [Qemu-devel] [PATCH v4 1/5] slirp/tcp_subr.c: fix coding style in tcp_connect, MORITA Kazutaka, 2013/01/29
- [Qemu-devel] [PATCH v4 5/5] sheepdog: add support for connecting to unix domain socket, MORITA Kazutaka, 2013/01/29
- [Qemu-devel] [PATCH v4 4/5] sheepdog: use inet_connect to simplify connect code, MORITA Kazutaka, 2013/01/29
- [Qemu-devel] [PATCH v4 3/5] sheepdog: accept URIs, MORITA Kazutaka, 2013/01/29
- [Qemu-devel] [PATCH v4 2/5] move socket_set_nodelay to osdep.c, MORITA Kazutaka, 2013/01/29