From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcDOC-0006KV-HC for qemu-devel@nongnu.org; Wed, 16 Sep 2015 10:08:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcDO6-0003S8-T7 for qemu-devel@nongnu.org; Wed, 16 Sep 2015 10:08:48 -0400 References: <1442411543-28513-1-git-send-email-berrange@redhat.com> <1442411543-28513-3-git-send-email-berrange@redhat.com> From: Eric Blake Message-ID: <55F977E3.2060807@redhat.com> Date: Wed, 16 Sep 2015 08:08:35 -0600 MIME-Version: 1.0 In-Reply-To: <1442411543-28513-3-git-send-email-berrange@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GTpccD6l2uB0kO7EDUOgVTK4PJlnCJPJa" 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" , qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --GTpccD6l2uB0kO7EDUOgVTK4PJlnCJPJa Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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. >=20 > Signed-off-by: Daniel P. Berrange > --- > qemu-nbd.c | 102 +++++++++++++++++++++++------------------------------= -------- > 1 file changed, 38 insertions(+), 64 deletions(-) >=20 > +static SocketAddress *nbd_build_socket_address(const char *sockpath, > + const char *bindto, > + const char *port) > +{ > + SocketAddress *saddr; > + > + saddr =3D g_new0(SocketAddress, 1); > + if (sockpath) { > + saddr->kind =3D SOCKET_ADDRESS_KIND_UNIX; More minor conflicts with my qapi cleanups. Not a show-stopper. > + saddr->q_unix =3D g_new0(UnixSocketAddress, 1); > + saddr->q_unix->path =3D g_strdup(sockpath); > + } else { > + saddr->kind =3D SOCKET_ADDRESS_KIND_INET; > + saddr->inet =3D g_new0(InetSocketAddress, 1); > + saddr->inet->host =3D g_strdup(bindto); > + if (port) { > + saddr->inet->port =3D g_strdup(port); > + } else { > + saddr->inet->port =3D g_strdup_printf("%d", NBD_DEFAULT_PO= RT); The qapi type is gross for requiring port as a string. But we have plans to clean that up, not a showstopper for this patch. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --GTpccD6l2uB0kO7EDUOgVTK4PJlnCJPJa 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+XfjAAoJEKeha0olJ0NqXGAIAKg1q/F0O5QH08KU6z6/wxkb 6qRJ+sgeM/+D+lN67kS/crUNE58kbqfnIwB65NYQUWEADGm/fbCny5gu5YtrhKZY +XSHmiFBs+Pi3K/pdMR4fGd8LKA43KCdK7FlV2Pk3UGA/qRHtkDjo73EKYYTDKjd xGUmbyJPpO/kziA/hF8WzJAEM1BNSUv9nJxPrqHdciiKENhzOA6JqlIwUgA/Xkf4 ZCdFyB4ha8xR8btiiaNbJ/ufEd8bCWUVvqCDbsU5qfL+9igJfLJKpC5KL95x5h2U CwulURBTGKn4hL6oz9j/buaFx43aFlMEeYJ40A63tQs+/+hGB63z1Gg5Wrm9igI= =yc/r -----END PGP SIGNATURE----- --GTpccD6l2uB0kO7EDUOgVTK4PJlnCJPJa--