[Pkg-xen-devel] Xen advice requested

Paul van der Vlis paul at vandervlis.nl
Wed Aug 6 08:58:19 UTC 2008


Thomas Goirand schreef:
> Paul van der Vlis wrote:
>> Thomas Goirand schreef:
>>> Paul van der Vlis wrote:
>>>>> sys.path.append( '/usr/lib/python' )
>>>>> import xen.xm.main as xenxm
>>>>> id = int(xenxm.sxp.child_value(info, 'id', '-1'))
>>>>> networkDeviceName="vif%s" % id
>>>>>
>>>>> As /usr/lib/python/xen doesn't exist, but instead there is a
>>>>> /usr/lib/python/xen-VERSION, the import fails if using the Debian package...
>>>> For me it worked out of the box. Maybe the problems were corrected
>>>> later? I use tools like xen-create-image and xm without problems.
>>> Can you do "ls -lah /usr/lib/python" in your setup, and show me the
>>> result? 
>> xen:~# ls -lah /usr/lib/python
>> ls: /usr/lib/python: No such file or directory
>> xen:~# ls -ld /usr/lib/python*
>> drwxr-xr-x  3 root root    80 2008-03-29 18:42 /usr/lib/python2.3
>> drwxr-xr-x 19 root root 12072 2008-04-29 17:05 /usr/lib/python2.4
>> drwxr-xr-x  3 root root    80 2008-03-29 18:47 /usr/lib/python2.5
>> drwxr-xr-x  5 root root   136 2008-03-29 18:47 /usr/lib/python-support
>> xen:~# ls -lah /usr/lib/python2.4
>> [...]
> 
> Hi,
> 
> That's exactly what I said, I didn't remember in details, by hart... I
> love Debian, and the fact that it sets things where they should be (conf
> files in /etc, etc.), but in that case, it just messes everything. How
> can I then include things that are supposed to be in /usr/lib/python/xen
> in a "normal" system? 

I don't know. Take a look at the filelist:
http://packages.debian.org/etch/i386/xen-utils-3.0.3-1/filelist

> What's the Debian way, or the pkg-xen-devel way?
> Where's located the "xm" python source code in the Debian package?

xen:~# ls -l `which xm`
lrwxrwxrwx 1 root root 39 2008-03-30 14:45 /usr/sbin/xm ->
../lib/xen-common/bin/xen-utils-wrapper

xen-utils-wrapper has this content:
----------
#!/bin/bash
libdir=/usr/lib
command="$(basename $0)"
version=$($libdir/xen-common/bin/xen-utils-version -v "$XEN_VERSION")
[ "$version" ] && exec "$libdir/xen-$version/bin/$command" "$@"
exit 127
------

What is /usr/lib/xen-3.0.3-1/bin/xm in my case.
But the code is really short:

cat /usr/lib/xen-3.0.3-1/bin/xm
#!/usr/bin/env python
#  -*- mode: python; -*-
import sys
sys.path.append('%s/../lib/python' % sys.path[0])
from xen.xm import main

main.main(sys.argv)

With regards,
Paul van der Vlis.




-- 
http://www.vandervlis.nl/




More information about the Pkg-xen-devel mailing list