All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Yu Zhiguo <yuzg@cn.fujitsu.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Keir Fraser <keir.fraser@eu.citrix.com>
Subject: Re: xl: Enable 'xl console' in 'x86_64'
Date: Wed, 28 Apr 2010 08:40:38 -0700	[thread overview]
Message-ID: <4BD856F6.4010503@goop.org> (raw)
In-Reply-To: <4BD80DF4.6000804@cn.fujitsu.com>

On 04/28/2010 03:29 AM, Yu Zhiguo wrote:
> 'xl console' cannot be used on arch 'x86_64',
> because the path of 'xenconsole' is wrong.
> Fix this bug.
>
> Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
>
> 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 <stdint.h>
>  #include <inttypes.h>
>  #include <assert.h>
> +#include <sys/utsname.h>
>  
>  #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";
> +    }
>   

Won't this fail if the tools were build 32bit, but being run on a 64bit
machine?  Why not just look in both places?  Or fix the xenconsole to
install in /usr/lib regardless of architecture (it isn't a library, so
nothing will care about its architecture).

    J

  reply	other threads:[~2010-04-28 15:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-28 10:29 xl: Enable 'xl console' in 'x86_64' Yu Zhiguo
2010-04-28 15:40 ` Jeremy Fitzhardinge [this message]
2010-04-29  2:38   ` Yu Zhiguo
2010-04-29 16:38     ` Jeremy Fitzhardinge
2010-04-29 17:54       ` Keir Fraser
2010-04-29 18:40         ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BD856F6.4010503@goop.org \
    --to=jeremy@goop.org \
    --cc=keir.fraser@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=yuzg@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.