Received: from eggs.gnu.org ([2001:4830:134:3::10]:48589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aflc2-0003xE-7N for qemu-devel@nongnu.org; Tue, 15 Mar 2016 05:50:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aflby-0004Zl-7R for qemu-devel@nongnu.org; Tue, 15 Mar 2016 05:50:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51588) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aflby-0004Zb-2C for qemu-devel@nongnu.org; Tue, 15 Mar 2016 05:49:58 -0400 Date: Tue, 15 Mar 2016 10:49:55 +0100 From: Christophe Fergeau Message-ID: <20160315094955.GD1546@edamame.cdg.redhat.com> References: <1457955672-28758-1-git-send-email-cfergeau@redhat.com> <56E6DBAE.1060408@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jL2BoiuKMElzg3CS" Content-Disposition: inline In-Reply-To: <56E6DBAE.1060408@redhat.com> Subject: Re: [Qemu-devel] [PATCH] spice: Disallow use of gl + TCP port List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , qemu-devel@nongnu.org, Gerd Hoffmann --jL2BoiuKMElzg3CS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 14, 2016 at 09:41:34AM -0600, Eric Blake wrote: > On 03/14/2016 05:41 AM, Christophe Fergeau wrote: > > Currently, virgl support has to go through a local unix socket, trying > > to connect to a VM using -spice gl through spice://localhost:5900 will > > only result in a black screen. > > This commit errors out when the user tries to start a VM with both GL > > support and a port/tls-port set. > > This would fit better in spice-server, but currently QEMU does not call > > into spice-server when parsing 'gl' on its command line, so we have to > > do this check in QEMU instead. > >=20 > > Signed-off-by: Christophe Fergeau > > --- > > ui/spice-core.c | 4 ++++ > > 1 file changed, 4 insertions(+) > >=20 > > diff --git a/ui/spice-core.c b/ui/spice-core.c > > index 7987a4e..94f3236 100644 > > --- a/ui/spice-core.c > > +++ b/ui/spice-core.c > > @@ -844,6 +844,10 @@ void qemu_spice_init(void) > > =20 > > #ifdef HAVE_SPICE_GL > > if (qemu_opt_get_bool(opts, "gl", 0)) { > > + if ((port !=3D 0) || (tls_port !=3D 0)) { >=20 > Overparenthesized; you could write: >=20 > if (port || tls_port) { >=20 > for the same effect with less typing. Yeah I know I'm overly verbose with these tests, the parentheses make it explicit that there are no operator priority issues, the !=3D 0 emphasize it's an integer type which is being handled. I'll change it to your recommendation before sending a v2. Christophe --jL2BoiuKMElzg3CS Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJW59rDAAoJEKnYwhQprGyCuTYP/2U8t5JUfuVK36GLf4CqoQW0 HVAqs4n60OaycjnN/cqbuJ9BA86zJPEOgfd/6MMDD++gWff2KFujFB2AtowB06C4 O6uiVLgWkYcgUITqk7dWJq0jtd6Sbgi8zVlw5Xo/lPHrrDkKbrQ4tyQ8r9DznVA0 3Jd5Im0XZFPzRqXEZDio9ULbGrhZokPIetpm531uXMFq2qqQFZphSlPdWKw1Tqii 9g5DCWka0X0uM1pyIqvOKqQyqAaLh30hrDLIlX4vU5zeUSZyvahWPwEaFBOWvhCm fY2CU4eatlqZBgSdo0cuHFrWig3Jy9FcJsEFbxqEkXV6F+Au/Tk7ElTuVxvoImWr Qvt9Zl2nyFkfEDdvMCwpJ+TlMFnr3N0HC41tv/8ESrtfo8KrHLqNUh9jdBjnoBUe uAwqWt3PPlM1mZlTG3iNahRy1LcBPj3I5+bhy/w8a5mkNQH9oCCp6rT5m9O5SV4D 79ewvTYhEv1dT4ni3UPVhKjukz3fwRgMdIeWkMsDUyzM9d+xRDwm6Usex6hS95L8 3JpqkaXH3zKiojXuGx2XLTbFmtWwZUnPa954qUCnNO1v5YqI6bOjgYSuEw35ZDNT k9TZCvaLCKjjjAG6ErDYPMabURXGzCSWRVIvAh8TzQ3joMEKCs6nK1OJKw+7Waaj zMgGyKtEtA3dI4g/FjIi =2ufm -----END PGP SIGNATURE----- --jL2BoiuKMElzg3CS--