From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NCUCU-00050W-AM for qemu-devel@nongnu.org; Mon, 23 Nov 2009 03:23:10 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NCUCP-0004lg-Fa for qemu-devel@nongnu.org; Mon, 23 Nov 2009 03:23:09 -0500 Received: from [199.232.76.173] (port=33911 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NCUCP-0004kq-3p for qemu-devel@nongnu.org; Mon, 23 Nov 2009 03:23:05 -0500 Received: from mx20.gnu.org ([199.232.41.8]:49804) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NCUCO-0006a6-FW for qemu-devel@nongnu.org; Mon, 23 Nov 2009 03:23:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NCUCM-0006KX-SY for qemu-devel@nongnu.org; Mon, 23 Nov 2009 03:23:03 -0500 Message-ID: <4B0A4648.1070307@redhat.com> Date: Mon, 23 Nov 2009 09:22:32 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/9] chardev: add greeting References: <1258450699-24445-1-git-send-email-kraxel@redhat.com> <1258450699-24445-2-git-send-email-kraxel@redhat.com> <200911201741.14183.paul@codesourcery.com> In-Reply-To: <200911201741.14183.paul@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-15; 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: qemu-devel@nongnu.org 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? cheers, Gerd