From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yui0z-0000Zx-Gl for qemu-devel@nongnu.org; Tue, 19 May 2015 09:57:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yui0v-0006hU-NH for qemu-devel@nongnu.org; Tue, 19 May 2015 09:57:01 -0400 Message-ID: <555B4127.4030700@redhat.com> Date: Tue, 19 May 2015 07:56:55 -0600 From: Eric Blake MIME-Version: 1.0 References: <1431519294-8873-1-git-send-email-M.Cerveny@computer.org> <1431519294-8873-2-git-send-email-M.Cerveny@computer.org> <555B31D9.2090806@suse.de> In-Reply-To: <555B31D9.2090806@suse.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="AxPn34jUE8ls0hU7QkowFmdIla0xMtu4W" Subject: Re: [Qemu-devel] [PATCH 1/2] scripts: qom-*: add network syntax List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , Martin Cerveny , qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Paolo Bonzini , Markus Armbruster , Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --AxPn34jUE8ls0hU7QkowFmdIla0xMtu4W Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/19/2015 06:51 AM, Andreas F=C3=A4rber wrote: > Am 13.05.2015 um 14:14 schrieb Martin Cerveny: >> Add network syntax parsing (ip address, port) to qom-* scripts. >> >> Signed-off-by: Martin Cerveny >> --- >> scripts/qmp/qom-fuse | 13 ++++++++++++- >> scripts/qmp/qom-get | 12 +++++++++++- >> scripts/qmp/qom-list | 12 +++++++++++- >> scripts/qmp/qom-set | 12 +++++++++++- >> scripts/qmp/qom-tree | 12 +++++++++++- >> 5 files changed, 56 insertions(+), 5 deletions(-) >=20 > Could some Python guru please take a look at this? That disqualifies me (still a python newbie), but I still see something questionable: >> =20 >> -srv =3D QEMUMonitorProtocol(socket_path) >> +connection =3D socket_path.split(':') >> +if len(connection) =3D=3D 2: >> + try: >> + port =3D int(connection[1]) >> + except ValueError: >> + raise QMPBadPort >> + connection =3D ( connection[0], port ) Won't that mishandle IPv6 connections, such as something like [::1]:8000 for connecting to port 8000 on localhost, since it splits into more than 2 pieces when splitting on :? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --AxPn34jUE8ls0hU7QkowFmdIla0xMtu4W 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/ iQEcBAEBCAAGBQJVW0EnAAoJEKeha0olJ0Nq87sH/3WNQ3gKEcggTz7XpDMNYYM/ nPiqvhH0KRFB+QE2e6DU7qoJAgwWSFGUTOtdd8Vdlt0IRY2OWpwgLO8w0FArNtRX E9qd3vv1eAIZJUSacJrsV5r392xQ6xDlomp16SPxdNShqIJlNStt6lJhiRuhiOK1 6maYtULUUwzq2VE3FIqQyVCPdYB9v41n3C+eUoa1qbMkUoCdmX52StynQwWQIH31 J9frQEmK+IjYUuzCeLBuyV6GPCWFry9+M+bgZYhDCPvVd1C4WFPeHtJki5OTsk5a Usm5xiIrH9NI3W+bqdwEQ9lIckfEpWCTYcMvTB+IDw/K7EtjRME4NxMXPWQBDHM= =pWWu -----END PGP SIGNATURE----- --AxPn34jUE8ls0hU7QkowFmdIla0xMtu4W--