From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yu Zhiguo Subject: xl: Enable 'xl console' in 'x86_64' Date: Wed, 28 Apr 2010 18:29:08 +0800 Message-ID: <4BD80DF4.6000804@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org 'xl console' cannot be used on arch 'x86_64', because the path of 'xenconsole' is wrong. Fix this bug. Signed-off-by: Yu Zhiguo diff -r c87ec146229a -r bb537e15d23a tools/libxl/libxl.c --- a/tools/libxl/libxl.c Fri Apr 23 15:04:26 2010 +0100 +++ b/tools/libxl/libxl.c Thu Apr 29 02:23:21 2010 +0800 @@ -28,6 +28,7 @@ #include #include #include +#include #include "libxl.h" #include "libxl_utils.h" @@ -741,8 +742,13 @@ { struct stat st; const char *XENCONSOLE = "/usr/lib/xen/bin/xenconsole"; + struct utsname utsbuf; char *cmd; + if (uname(&utsbuf) != -1) { + if (!strcmp(utsbuf.machine, "x86_64") || !strcmp(utsbuf.machine, "ia64")) + XENCONSOLE = "/usr/lib64/xen/bin/xenconsole"; + } if (stat(XENCONSOLE, &st) != 0) { XL_LOG(ctx, XL_LOG_ERROR, "could not access %s", XENCONSOLE); return ERROR_FAIL;