From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NKF5v-0006MX-1S for qemu-devel@nongnu.org; Mon, 14 Dec 2009 12:52:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NKF5p-0006HA-DZ for qemu-devel@nongnu.org; Mon, 14 Dec 2009 12:52:25 -0500 Received: from [199.232.76.173] (port=46795 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKF5p-0006Gx-4B for qemu-devel@nongnu.org; Mon, 14 Dec 2009 12:52:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57601) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NKF5o-0004rd-Ob for qemu-devel@nongnu.org; Mon, 14 Dec 2009 12:52:21 -0500 Subject: Re: [Qemu-devel] Re: Spice project is now open From: Mark McLoughlin In-Reply-To: <20091214151056.GG23733@redhat.com> References: <4B231182.1080208@codemonkey.ws> <20091212144433.GA26966@random.random> <4B23B0BE.7080408@codemonkey.ws> <20091212160626.GB26966@random.random> <4B23D585.70400@codemonkey.ws> <4B241A99.2000704@redhat.com> <4B242B40.4050409@codemonkey.ws> <4B24C5EF.2090607@redhat.com> <4B264EC4.7020500@codemonkey.ws> <20091214151056.GG23733@redhat.com> Content-Type: text/plain; charset="UTF-8" Date: Mon, 14 Dec 2009 17:52:13 +0000 Message-Id: <1260813133.20801.17.camel@blaa> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: Mark McLoughlin List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Andrea Arcangeli , dlaor@redhat.com, qemu-devel@nongnu.org, Avi Kivity , Paolo Bonzini On Mon, 2009-12-14 at 15:10 +0000, Daniel P. Berrange wrote: > The model I had in mind was for the proxy to define a VNC extension that > allows the client to query what 'desktops' are available and request > switching between them at any time. The list of desktop would of course > be authorized per client, and strong authentication is a must for this. > > Any time a switch was made, the RFB protocol would return to the > 'ServerInit' state. The idea is that you should not assume a homogenous > environment, and you really don't want to fall down to the lowest common > denominator of extensions, nor have the proxy doing re-encoding on the FB > data updates. Returning to the ServerInit state allowing the client to > re-negotiate the set of encodings for the new desktop, and so the proxy > can be fairly stateless and while needing to understand the wire protocol, > it can just pass through the actual FB update data unchanged. > > The combo of the an extension for switching desktops on the fly and the > encryption state problem doesn't really seem to fit with passing the VNC > FD over with SCM_RIGHTS. I actually did a demo of this before, in a slightly different context. The idea was: - vnc client connects to gdm, which spawned a Xvnc(A) server with a gdm auth dialog - user logs in and if you've an Xvnc server already, it would move the client connection to the original Xvnc(B) server - first, gdm would tell the (A) to sync it's state; (A) would stop sending updates, flush its zlib/tls streams and pass gdm the current state of the connection - e.g. the protocol version, pixel format, supported encodings etc. - then gdm would pass the connection fd using SCM_RIGHTS to the existing Xvnc along with the connection state, and (B) would pick up the connection - from the users point of view, they were logged instantly back into their old session Simply flushing the encryption/compression state was the key, but AFAIR clients needed a trivial fix to allow them to properly handle the server flushing the stream. The alternative was to somehow get the server to dump its encryption/compression state and pass that to the existing server, but that seemed quite difficult when I looked. SCM_RIGHTS rule ... this was definitely one of the most fun hacks I've done :-) Cheers, Mark. p.s. - I'm sure I can dig up the code, here are some diffs that look like older than what I remember finishing: http://www.gnome.org/~markmc/code/gdm-vnc-support.patch http://www.gnome.org/~markmc/code/test-gnutls-client-close-restart.c http://www.gnome.org/~markmc/code/test-gnutls-server-close-restart.c http://www.gnome.org/~markmc/code/test-zlib.c http://www.gnome.org/~markmc/code/vnc-4.0b5-vncviewer-tls.diff http://www.gnome.org/~markmc/code/vnc-managed.patch http://www.gnome.org/~markmc/code/vnc-tls.patch