Received: from eggs.gnu.org ([140.186.70.92]:44981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZlQb-0007RM-0l for qemu-devel@nongnu.org; Thu, 23 Jun 2011 11:02:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZlQV-0002fb-Bx for qemu-devel@nongnu.org; Thu, 23 Jun 2011 11:02:44 -0400 Received: from smtp.eu.citrix.com ([62.200.22.115]:11809) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZlQU-0002fE-VH for qemu-devel@nongnu.org; Thu, 23 Jun 2011 11:02:39 -0400 From: Ian Campbell In-Reply-To: References: <1308561383-18964-1-git-send-email-cyliu@novell.com> Content-Type: text/plain; charset="UTF-8" Date: Thu, 23 Jun 2011 16:02:34 +0100 Message-ID: <1308841354.6920.218.camel@zakaz.uk.xensource.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Support logging xen-guest console List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini Cc: Chunyan Liu , "qemu-devel@nongnu.org" On Mon, 2011-06-20 at 19:42 +0100, Stefano Stabellini wrote: > > @@ -198,6 +248,10 @@ static int con_init(struct XenDevice *xendev) > > else > > con->chr = serial_hds[con->xendev.dev]; > > > > + logenv = getenv("XENCONSOLED_TRACE"); > > + if (logenv != NULL && !strcmp(logenv, "guest")) { > > + log_guest = 1; > > + } > > return 0; > > } > > please check the length of logenv before using strcmp on it surely getenv() isn't the correct interface anyway? What guarantees that the environment running qemu will have the /etc/sysconfig/xencommons derived settings in it? It's not usually the case under xl unless the user happens to have sources the file (which would be strange). Also XENCONSOLED_TRACE is clearly a setting aimed at xenconsoled -- not qemu. In fact it is really a setting for the xencommons initscript which turns it into the appropriate xenconsoled command line option. Perhaps we should be plumbing the console to xenconsoled (like we do for serial = pty), that'll get us this logging for free and be consistent to Xen users compared with PV guests, HVM serial=pty and similar... The other option would be to properly plumb this stuff through the qemu command line and make use of it from the Xen toolstack as necessary. Ian.