From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcDdf-00076V-BU for qemu-devel@nongnu.org; Wed, 16 Sep 2015 10:24:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcDde-00030H-8U for qemu-devel@nongnu.org; Wed, 16 Sep 2015 10:24:47 -0400 References: <1442411543-28513-1-git-send-email-berrange@redhat.com> <1442411543-28513-3-git-send-email-berrange@redhat.com> <55F977E3.2060807@redhat.com> <20150916141335.GF21184@redhat.com> From: Eric Blake Message-ID: <55F97BA7.8080909@redhat.com> Date: Wed, 16 Sep 2015 08:24:39 -0600 MIME-Version: 1.0 In-Reply-To: <20150916141335.GF21184@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Oa2LVvIgGMeUe51Ous4BatSdtSlIjFrSN" Subject: Re: [Qemu-devel] [PATCH v1 2/2] qemu-nbd: convert to use the QAPI SocketAddress object List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Kevin Wolf , Paolo Bonzini , qemu-devel@nongnu.org, qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Oa2LVvIgGMeUe51Ous4BatSdtSlIjFrSN Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/16/2015 08:13 AM, Daniel P. Berrange wrote: > On Wed, Sep 16, 2015 at 08:08:35AM -0600, Eric Blake wrote: >> On 09/16/2015 07:52 AM, Daniel P. Berrange wrote: >>> The qemu-nbd program currently uses a QemuOpts objects >>> when setting up sockets. Switch it over to use the >>> QAPI SocketAddress objects instead. >>> >>> + if (port) { >>> + saddr->inet->port =3D g_strdup(port); >>> + } else { >>> + saddr->inet->port =3D g_strdup_printf("%d", NBD_DEFAULT_= PORT); >> >> The qapi type is gross for requiring port as a string. But we have pla= ns >> to clean that up, not a showstopper for this patch. >=20 > On the contrary - QAPI is correct in requiring this, as it lets you > provide a service name (as defined in /etc/services) instead of a > numeric port, and getaddrinfo() will look that up and convert to > numeric format. What it SHOULD be doing it taking an 'alternate' that allows both a string (for getaddrinfo lookup) and an int (for direct port usage), rather than overloading a string for both uses. But as I said, that should be a future cleanup, affecting more uses of the qapi type than just this patch. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Oa2LVvIgGMeUe51Ous4BatSdtSlIjFrSN 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/ iQEcBAEBCAAGBQJV+XunAAoJEKeha0olJ0NqyvcH/3Y6Hjrti96lD8HRMe19knNU 46WYw/hQcXV2VkHTtwCfVgzXA5oGELRsAcqoJLKSTmgGm8Mikg/o3H0ubbgTrIKd 0hwege8sKG3bhs5Tbq+v+LeS5fp22GMqhlBcClz34my+KlbO65xLOzijCNHyn07I JGoWl4HwDX4gv5PPnV4esuRYL3Z3Hl8PwsfhrXL3G6o8dD/2XWsfHq68WLnuWxAv Q5s5rerCHiEuu8G4sdVwwMa5O1SRw41uWD83ksn0HpFvCi+05oTaIGie6WcyMhJy qnsglibDIkXnCMF2LPx+3dDZEbWYFVFVtHN1O6Ce2rJChO7QU2AaUoo3ZjPX6Hg= =FYIG -----END PGP SIGNATURE----- --Oa2LVvIgGMeUe51Ous4BatSdtSlIjFrSN--