From: Ian Jackson Subject: Re: [PATCH 2 of 4] xenconsole: add support for a console type parameter Date: Fri, 13 Aug 2010 16:26:13 +0100 Message-ID: <19557.25621.494399.978796@mariner.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefano Stabellini Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Stefano Stabellini writes ("[Xen-devel] [PATCH 2 of 4] xenconsole: add support for a console type parameter"): > xenconsole: implement support for an explicit console type parameter > > This patch adds support to xenconsole for an explicity console "type" > parameter. The parameter can be "pv", to specify that the user wants to > connect to a pv console, or "serial", to specify that the user wants to > connect to an emulated serial. > If the type parameter hasn't been specified be the user, xenconsole > tries to guess which type of console it has to connect to, defaulting to > pv console for pv guests and emulated serial for hvm guests. > > This patch also changes the xenstore paths corresponding to pv consoles > to the console prefix, leaving the serial prefix to emulated serials. > > Signed-off-by: Stefano Stabellini > > diff -r 6b28b2dac7dd tools/console/client/main.c > --- a/tools/console/client/main.c Thu Aug 05 11:36:24 2010 +0100 > +++ b/tools/console/client/main.c Mon Aug 09 14:26:22 2010 +0100 ... > - path = malloc(strlen(dom_path) + strlen("/serial/0/tty") + 5); > [ 27 lines to determine whether guest is HVM or PV ] Is this really the best way to do this ? Is there no other function somewhere which will do this more sensibly ? Perhaps xenconsole needs to become a libxl caller rather than a helper program run by xl console. Aside from that, I'm happy with this patch. Ian.