From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NCYvr-0007bT-ER for qemu-devel@nongnu.org; Mon, 23 Nov 2009 08:26:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NCYvm-0007WS-Kg for qemu-devel@nongnu.org; Mon, 23 Nov 2009 08:26:18 -0500 Received: from [199.232.76.173] (port=45299 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NCYvm-0007W7-CW for qemu-devel@nongnu.org; Mon, 23 Nov 2009 08:26:14 -0500 Received: from mx20.gnu.org ([199.232.41.8]:4629) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NCYvm-0008Bb-3O for qemu-devel@nongnu.org; Mon, 23 Nov 2009 08:26:14 -0500 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NCYvj-0002Ln-Lz for qemu-devel@nongnu.org; Mon, 23 Nov 2009 08:26:12 -0500 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH 1/9] chardev: add greeting Date: Mon, 23 Nov 2009 13:26:09 +0000 References: <1258450699-24445-1-git-send-email-kraxel@redhat.com> <200911201741.14183.paul@codesourcery.com> <4B0A4648.1070307@redhat.com> In-Reply-To: <4B0A4648.1070307@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <200911231326.09362.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann On Monday 23 November 2009, Gerd Hoffmann wrote: > On 11/20/09 18:41, Paul Brook wrote: > > On Tuesday 17 November 2009, Gerd Hoffmann wrote: > >> Add a greeting string to CharDriverState which is printed after > >> initialization. Used to have the qemu vc consoles labeled. This > >> way we can avoid walking all the chardevs a second time after > >> initialization just to print the greeting. > > > > I think "greeting" is propagating a bad idea into new code. Much better > > would be some form of ID and/or human readable description that can also > > be used elsewhere. > > The naming is only one part of the problem. The second part is that the > greeting is printed only for the 'vc' backend (where you really need it > because there is no other way to figure what chardev you are looking at > when switching screens via Ctrl-Alt-). > > There already is a 'label' field. So we could add a flag instead of a > string, then do: > > if (chr->want_greeting) > qemu_chr_printf(chr, "%s console\n", chr->label); > > How about this? I thinking more that this should be done by the character backend itself. For example, the "graphical" consoles should probably be putting this as part of the window title rather than having the interface layer randomly send extra characters in connect. Paul