From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: Re: is the xen toolstack backwards compatible ? Date: Wed, 9 Dec 2009 11:06:58 +0100 Message-ID: <200912091106.58517.Christoph.Egger@amd.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_Cb3HLPHZCpcdlm4" 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: Keir Fraser Cc: Sander Eikelenboom , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --Boundary-00=_Cb3HLPHZCpcdlm4 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wednesday 09 December 2009 08:22:14 Keir Fraser wrote: > On 09/12/2009 00:23, "Sander Eikelenboom" wrote: > > So if it was no coincidence but desirable, at the moment xend and xentop > > from unstable don't seem to work on 3.4.2 hypervisor anymore. > > There's no compatibility guarantee across different major Xen releases. But > Christoph Egger did a lot of work to allow multiple toolstacks to be > installed side by side. I think you should just need to specify a > PREFIX=/path/to value when building the tools. Is that right, Christoph? Yes, this is right. *Before* you start xend, you need to set two environment variables LD_LIBRARY_PATH and PYTHONPATH. Here is an example for PREFIX="/usr/local" and compiled with python 2.5: export LD_LIBRARY_PATH="/usr/local/lib" export PYTHONPATH="/usr/local/lib/python2.5/site-packages" If these are not set correct, python tells you it can't find its modules or the dynamic linker tells you it can't find the shared libs built from tools/libxc. You should use the same python version you compiled with. If you are on a machine where 'python' does not exist as a symbolic link to the installed python version (like me on NetBSD) you need the attached patch or all python programs installed with "INSTALL_PYTHON_PROG" end up with '#!' in the first line instead of '#!/path/to/python2.5' which is stupid. I already submitted attached patch earlier but Ian Jackson objected it because he wants a way to have tools working with a different python version than it has been compiled with. This sounds obscure to me when looking at the path python modules get installed to. Keir: Please take attached patch. This is better than the current situation regardless Ian likes it or not. In the latter case taking the patch should motivate him to come up with a patch finally. :) Again: Signed-off-by: Christoph Egger --Boundary-00=_Cb3HLPHZCpcdlm4 Content-Type: text/x-diff; charset="iso 8859-15"; name="xen_python.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen_python.diff" diff -r bc3aca17cb88 tools/misc/Makefile --- a/tools/misc/Makefile Thu Jul 23 09:01:30 2009 +0100 +++ b/tools/misc/Makefile Thu Jul 23 15:45:48 2009 +0200 @@ -25,8 +25,7 @@ INSTALL_BIN := $(INSTALL_BIN-y) INSTALL_SBIN-y := xm xen-bugtool xen-python-path xend xenperf xsview xenpm xen-tmem-list-parse gtraceview gtracestat INSTALL_SBIN := $(INSTALL_SBIN-y) -DEFAULT_PYTHON_PATH := $(shell $(XEN_ROOT)/tools/python/get-path) -PYTHON_PATH ?= $(DEFAULT_PYTHON_PATH) +PYTHON_PATH := $(shell which $(PYTHON)) INSTALL_PYTHON_PROG = $(XEN_ROOT)/tools/python/install-wrap \ "$(PYTHON_PATH)" $(INSTALL_PROG) diff -r bc3aca17cb88 tools/python/get-path --- a/tools/python/get-path Thu Jul 23 09:01:30 2009 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -#! /usr/bin/env bash -set -e - -check () { - set +e - p=`type -p python$v` - r=$? - set -e - if [ $r = 0 ]; then - echo >&2 "${0##*/}: will use #!$p for python programs" - printf "%s\n" "$p" - exit 0 - fi -} - -v="$(python -V 2>&1)" -v="${v#* }" -check -v="${v%.*}" -check -echo >&2 'python version not determined, will use env to find python at runtime' -printf "/usr/bin/env python\n" diff -r bc3aca17cb88 tools/python/install-wrap --- a/tools/python/install-wrap Thu Jul 23 09:01:30 2009 +0100 +++ b/tools/python/install-wrap Thu Jul 23 15:45:48 2009 +0200 @@ -1,44 +1,60 @@ -#! /usr/bin/env bash +#!/bin/sh # usage: # .../install-wrap $(PYTHON_PATH) install ... # where # PYTHON_PATH is what to put after #! and may be `/usr/bin/env python' # -# Used via $(INSTALL_PYTHON_PROG) in Rules.mk; PYTHON_PATH comes from -# .../get-path alongside this script +# Used via $(INSTALL_PYTHON_PROG) in Rules.mk; PYTHON_PATH comes from $(PYTHON) set -e -if [ $# -lt 2 ]; then echo >&2 "${0##*/}: too few arguments"; exit 1; fi -pythonpath="$1"; shift +if test $# -lt 2; then + echo >&2 "${0##*/}: too few arguments" + exit 1 +fi -install=("$1"); shift -srcs=() +pythonpath="$1" +shift + +install="$1" +shift +srcs="" while [ $# != 0 ]; do case "$1" in - -|--) install=("${install[@]}" "$1"); shift; break ;; - -*) install=("${install[@]}" "$1"); shift ;; - *) break ;; + -|--) install=`echo "${install} $1"` + shift + break + ;; + -*) install=`echo "${install} $1"` + shift + ;; + *) break + ;; esac done -while [ $# -gt 1 ]; do - srcs=("${srcs[@]}" "$1"); shift + +while test $# -gt 1; do + srcs=`echo "${srcs} $1"` + shift done -dest="$1"; shift + +dest="$1" +shift destf="$dest" -for srcf in "${srcs[@]}"; do +for srcf in ${srcs}; do if test -d "$dest"; then - destf="$dest/${srcf%%*/}"; + destf="$dest/${srcf%%*/}" fi org="$(sed -n '2q; /^#! *\/usr\/bin\/env python *$/p' $srcf)" - if [ "x$org" = x ]; then - "${install[@]}" "$srcf" "$destf" + if test "x$org" = x; then + eval "${install} $srcf $destf" continue fi tmpf="$destf.tmp" - "${install[@]}" "$srcf" "$tmpf" + eval "${install} $srcf $tmpf" printf >"$tmpf" "#!%s\n" "$pythonpath" sed -e 1d "$srcf" >>"$tmpf" mv -f "$tmpf" "$destf" done +exit 0 --Boundary-00=_Cb3HLPHZCpcdlm4 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_Cb3HLPHZCpcdlm4--