From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qkhc0-0008OW-Ne for qemu-devel@nongnu.org; Sat, 23 Jul 2011 15:11:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qkhby-00043L-Ep for qemu-devel@nongnu.org; Sat, 23 Jul 2011 15:11:44 -0400 Received: from mail-gx0-f173.google.com ([209.85.161.173]:64472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qkhby-000434-Ax for qemu-devel@nongnu.org; Sat, 23 Jul 2011 15:11:42 -0400 Received: by gxk26 with SMTP id 26so2052802gxk.4 for ; Sat, 23 Jul 2011 12:11:41 -0700 (PDT) Message-ID: <4E2B1CEB.5040606@codemonkey.ws> Date: Sat, 23 Jul 2011 14:11:39 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1310633908-11520-1-git-send-email-cyliu@novell.com> <4E2AE76A.1050302@codemonkey.ws> <7740093E-1D7B-4D0C-8D77-5C9126BCB52D@suse.de> In-Reply-To: <7740093E-1D7B-4D0C-8D77-5C9126BCB52D@suse.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V2] Add "tee" option to qemu char device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Chunyan Liu , qemu-devel@nongnu.org On 07/23/2011 01:31 PM, Alexander Graf wrote: > > On 23.07.2011, at 17:23, Anthony Liguori wrote: > >> On 07/14/2011 03:58 AM, Chunyan Liu wrote: >>> Add "tee" backend to char device. It could be used as follows: >>> -serial tee:filepath,pty >>> -chardev tee,tee_fpath=path,tee_backend=pty,,path=path,,[mux=on|off] >>> With "tee" option, "pty" output would be duplicated to filepath. >>> Related thread: >>> http://lists.nongnu.org/archive/html/qemu-devel/2011-07/msg00105.html >> >> I loathe adding even more complexity to the the char layer. Can't you do this just as well with socat? > > I disagree. For socat we'd have to open some listening port (unix, tcg, etc) and then have socat connect to it. And what's the problem? Use a unix domain socket and call it a day. > While socat is not up yet, the VM won't run. It also adds another layer of complexity (syncing of socat and qemu process) to the picture that I don't like. These arguments all apply to any possible option. Why not a grep target? Why not a cut or less target? > As long as the tee target is reasonably isolated, I don't think it'd clutter the char backend. It'll never be tested and end up becoming dead bloat code. For uncommon use cases where there's another way to do something with no real obvious technical advantages, using existing code (and utilities) always wins vs reinventing the wheel IMHO. Regards, Anthony Liguori