From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M3hfk-0005PF-2i for qemu-devel@nongnu.org; Mon, 11 May 2009 22:24:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M3hfe-0005Nd-Ux for qemu-devel@nongnu.org; Mon, 11 May 2009 22:24:47 -0400 Received: from [199.232.76.173] (port=43343 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M3hfe-0005Na-Qs for qemu-devel@nongnu.org; Mon, 11 May 2009 22:24:42 -0400 Received: from qw-out-1920.google.com ([74.125.92.146]:25744) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M3hfe-0007eH-Ip for qemu-devel@nongnu.org; Mon, 11 May 2009 22:24:42 -0400 Received: by qw-out-1920.google.com with SMTP id 4so1739572qwk.4 for ; Mon, 11 May 2009 19:24:30 -0700 (PDT) Message-ID: <4A08DDDA.309@codemonkey.ws> Date: Mon, 11 May 2009 21:24:26 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Transforming stdin and stdout pair into a socket References: <8e04b5820905101119u39ae84bfp1bae24be6e057086@mail.gmail.com> <4A0813D6.3050609@codemonkey.ws> <8e04b5820905110632q1a3b9ad4u49d4f3208d994755@mail.gmail.com> <200905120007.24881.paul@codesourcery.com> In-Reply-To: <200905120007.24881.paul@codesourcery.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: nbd-general@lists.sourceforge.net, "Ciprian Dorin, Craciun" , linux-newbie@vger.kernel.org, qemu-devel@nongnu.org Paul Brook wrote: >> I've seen socat, and I could use it as you described. My only >> objection to this solution is that there is an unneeded process in the >> middle that just pipes data around... >> >> (Instead of socat, I think it would be more efficient to just write >> a simple application that uses the "new" Linux syscall "splice" that >> I've just found by mistake yesterday...) >> > > In that case you need to fix socat to use splice() when available. I have a > hard time believing socat adds measurable overhead, especially if you're > already tunnelling over ssh. > splice() doesn't really buy you anything when copying from a socket to another socket. The data is going to get copied just like it would if you dropped to userspace. It's useful if you introduce pipe-to-pipe copies because they'll be eliminated but if you're going from socket -> pipe -> socket it'll be the same as using socat. Regards, Anthony Liguori > Paul >