From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QG0Th-00067u-PI for qemu-devel@nongnu.org; Fri, 29 Apr 2011 23:04:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QG0Tg-0005gn-Rl for qemu-devel@nongnu.org; Fri, 29 Apr 2011 23:04:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58157) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFw2S-0007cl-B7 for qemu-devel@nongnu.org; Fri, 29 Apr 2011 18:19:52 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3TMJox6011341 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 29 Apr 2011 18:19:50 -0400 Date: Sat, 30 Apr 2011 01:19:44 +0300 From: Alon Levy Message-ID: <20110429221944.GD13837@amber.local> References: <1303979358-4421-1-git-send-email-alevy@redhat.com> <1303979358-4421-4-git-send-email-alevy@redhat.com> <4DBAAA92.60409@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DBAAA92.60409@redhat.com> Subject: Re: [Qemu-devel] [PATCHv2 3/4] qxl: add debug_cs and cmdlog_cs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org On Fri, Apr 29, 2011 at 02:09:54PM +0200, Gerd Hoffmann wrote: > On 04/28/11 10:29, Alon Levy wrote: > >With this you can output the command log and/or the guest debug (driver) > >output to a chardev instead of stderr: > > > >-global qxl-vga.cmdlog_chardev=qxl_cmdlog_chardev > >-global qxl-vga.debug_chardev=qxl_debug_chardev > > > >useful for debugging. if no chardev is specified prints to stderr like the old > >code. > > Hmm. That is a bit too much ad-hoc debug hacking IMHO. Also I'm > not sure I like the idea to send debug stuff through chardev instead > of just writing them to stderr or some logfile. > > I do see why you are doing that though. Unfortunaly qemu has no > sane debug logging infrastructure. This is long overdue IMHO, so we > don't need hacks like this one and also don't reinvent stuff over > and over. The bigger hack called "qxl_terse" I didn't even send :) ok, so now I get to either keep this in my closet or think of how to do a minimal acceptable qemu logging infrastructure that would let me register a logging handle and use that to redirect to a chardev (they would all default to being muxed over stdio?) QemuLogger *qemu_create_logger(const char *logger_id); - logger_id is used to match to the chardev given on the command line - need to prevent collision, so probably easier to have a logger_id be an int and have that looked up to a string in an automatically generated table? struct QemuLogger { CharDriverState *chr; }; And command line would be: -chardev bla,id=myid -debug qxl,myid qxl->logger = qemu_create_logger("qxl"); qemu_chr_write(qxl->logger->chr, ..) logger creation would have to happen before command line parsing, so in the device initialization. Sounds right? > > cheers, > Gerd >