From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zyovz-0006mI-Af for qemu-devel@nongnu.org; Tue, 17 Nov 2015 17:41:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zyovw-0002mR-4t for qemu-devel@nongnu.org; Tue, 17 Nov 2015 17:41:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48928) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zyovv-0002mN-Tp for qemu-devel@nongnu.org; Tue, 17 Nov 2015 17:41:04 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 7C8A63D496 for ; Tue, 17 Nov 2015 22:41:03 +0000 (UTC) References: <1447779624-21625-1-git-send-email-berrange@redhat.com> <1447779624-21625-4-git-send-email-berrange@redhat.com> From: Eric Blake Message-ID: <564BACFA.4070105@redhat.com> Date: Tue, 17 Nov 2015 15:40:58 -0700 MIME-Version: 1.0 In-Reply-To: <1447779624-21625-4-git-send-email-berrange@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MhiUFF1j5dvJ9PEwdQuVuDOkwoxApxDW1" Subject: Re: [Qemu-devel] [PATCH v2 3/5] sockets: remove use of QemuOpts from socket_connect List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" , qemu-devel@nongnu.org Cc: Paolo Bonzini , Gerd Hoffmann This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MhiUFF1j5dvJ9PEwdQuVuDOkwoxApxDW1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/17/2015 10:00 AM, Daniel P. Berrange wrote: > The socket_connect method accepts a QAPI SocketAddress object > which it then turns into QemuOpts before calling the > inet_connect_opts/unix_connect_opts helper methods. By > converting the latter to use QAPI SocketAddress directly, > the QemuOpts conversion step can be eliminated >=20 > This also fixes the problem where ipv4=3Doff && ipv6=3Doff > would be treated the same as ipv4=3Don && ipv6=3Don >=20 > Signed-off-by: Daniel P. Berrange > --- > util/qemu-sockets.c | 91 +++++++++++++++++++++------------------------= -------- > 1 file changed, 36 insertions(+), 55 deletions(-) >=20 > ai.ai_flags =3D AI_CANONNAME | AI_V4MAPPED | AI_ADDRCONFIG; > - ai.ai_family =3D PF_UNSPEC; > + ai.ai_family =3D inet_ai_family_from_address(saddr, &err); > ai.ai_socktype =3D SOCK_STREAM; > =20 > =20 > - if (qemu_opt_get_bool(opts, "ipv4", 0)) { > - ai.ai_family =3D PF_INET; > - } > - if (qemu_opt_get_bool(opts, "ipv6", 0)) { > - ai.ai_family =3D PF_INET6; I'm using the notation you used in 2/5, where - is unspecified, f is explicitly false, and t is explicitly true. qemu_opt_get_bool(, 0) cannot tell the difference between - and f. The old code treated 4=3D- and 6=3D- as PF_UNSPEC; 4=3Df and 6=3Df as PF_= UNSPEC, and 4=3Dt and 6=3Dt as PF_INET6. That doesn't quite jive with the commit= message claiming that 4=3Doff (is that '4=3D-' or '4=3Df'?) and 6=3Doff w= as the same as 4=3Don (4=3Dt) and 6=3Don. However, I definitely agree with using inet_ai_family_from_address() rather than the old code. The code looks correct, but I want to make sure the commit message matches before giving R-b. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --MhiUFF1j5dvJ9PEwdQuVuDOkwoxApxDW1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWS6z6AAoJEKeha0olJ0NqSX4H/0yFrEDonwklT18xGmWiVIrG EBryWe7MjYJGMuDAl+n/4dI3TDZgE55L6AqYPLTBIxf8fziTfPX60qU25jO/35RV DLg5IOobQoqmI0hJ/jOopvVxjcB1VZomt7fqnS4DExxKqdkpkDVv04HyFNbGox22 SvnIAfET2WEeOOOEhej/soQy1bZzIdftM59sOp+1iHga+qHd0ww/dtWNxeamajzV PtqGrx6b7Lh6riZpUzeKS/bC24DS3zptsvUkGDub0V3qvPFRY2NSiBZ+/VYL5r+C J2DY4THvJbdlhAqBCwwPazNx4p+qMlu4rXW6WwoiPU6eRIHXnuVL0BZEarN/bIw= =GzXF -----END PGP SIGNATURE----- --MhiUFF1j5dvJ9PEwdQuVuDOkwoxApxDW1--