From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIzIg-0008IV-Jn for qemu-devel@nongnu.org; Wed, 04 Feb 2015 07:43:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIzIc-0004NU-9g for qemu-devel@nongnu.org; Wed, 04 Feb 2015 07:43:22 -0500 Received: from mail-wg0-x22f.google.com ([2a00:1450:400c:c00::22f]:45092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIzIc-0004NQ-2p for qemu-devel@nongnu.org; Wed, 04 Feb 2015 07:43:18 -0500 Received: by mail-wg0-f47.google.com with SMTP id n12so1496896wgh.6 for ; Wed, 04 Feb 2015 04:43:17 -0800 (PST) Sender: Paolo Bonzini Message-ID: <54D213E0.8090408@redhat.com> Date: Wed, 04 Feb 2015 13:43:12 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20150204113229.GN3032@redhat.com> In-Reply-To: <20150204113229.GN3032@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] RFC: Universal encryption on QEMU I/O channels List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" , qemu-devel@nongnu.org On 04/02/2015 12:32, Daniel P. Berrange wrote: > So my idea would be that we define a QEMUChannel object and set of APIs to > standardize all interaction with sockets, pipes, RDMA, whatever $channel, > and then convert the QEMU features I've mentioned over to use that. I think > that would be simpler than trying to untangle QEMUFile code from migration > and then extend its features. Could it be GIOChannel simply? 1) Chardev is already mostly a wrapper around GIOChannel 2) NBD and VNC could be converted to GIOChannel with relative ease 3) migration is more complicated because (unlike everything else) it uses a separate thread and blocking sockets, but you could probably write a GIOChannel-based implementation of QEMUFile. I found a GIOChannel wrapper for gnutls at https://github.com/aldebaran/connman/blob/master/gweb/giognutls.c. It's not the right license for QEMU (GPLv2-only) but it's only 400 lines of code. If necessary I can help with clean-room reverse engineering. Paolo