From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Un8wL-0004dB-VM for qemu-devel@nongnu.org; Thu, 13 Jun 2013 10:55:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Un8wI-0003fF-Tg for qemu-devel@nongnu.org; Thu, 13 Jun 2013 10:55:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9976) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Un8wI-0003eR-K7 for qemu-devel@nongnu.org; Thu, 13 Jun 2013 10:55:50 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5DEtn1c019954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 13 Jun 2013 10:55:49 -0400 Message-ID: <51B9DD72.7030805@redhat.com> Date: Thu, 13 Jun 2013 16:55:46 +0200 From: =?UTF-8?B?SsOhbiBUb21rbw==?= MIME-Version: 1.0 References: <338c8491ea5865aca71d84175673a2b164e3bf85.1370274768.git.jtomko@redhat.com> <51AE5BBE.2070908@redhat.com> In-Reply-To: <51AE5BBE.2070908@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/2] nbd: strip braces from literal IPv6 address in URI List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On 06/04/2013 11:27 PM, Paolo Bonzini wrote: > Il 03/06/2013 17:54, J=C3=A1n Tomko ha scritto: >> Otherwise they would get passed to getaddrinfo and fail with: >> address resolution failed for [::1]:1234: Name or service not known >=20 > Hmm... Hai Huang found a similar problem: >=20 > error: internal error unable to execute QEMU command 'nbd-server-start'= : > address resolution failed for [::]:5900: Name or service not known >=20 That one should be fixed in libvirt-1.0.5.2 and libvirt-1.0.6 now. [1] > This one is a libvirt bug, but perhaps it's simpler to just have a > wrapper for getaddrinfo that strips brackets (and not strip the bracket= s > in inet_parse, too). I'm not sure if there are places other than calling getaddrinfo where hav= ing brackets would be bad, I'm not that familiar with QEMU code. I've thought about stripping the brackets in uri_parse too, as we do in libvirt when parsing URIs. This wouldn't fix the case of someone specifyi= ng a bracket-ecaped hostname where there is no need for escaping it, like the libvirt bug. And my patch is incomplete, because there are other block drivers calling uri_parse without stripping the brackets. Jan [1] http://libvirt.org/git/?p=3Dlibvirt.git;a=3Dcommitdiff;h=3D3accd7eb