[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] python xs.read/write in domU

  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: "Kareem Dana" <kareem.dana@xxxxxxxxx>
  • Date: Tue, 19 Feb 2008 11:00:31 -0500
  • Delivery-date: Tue, 19 Feb 2008 08:00:55 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=rRL7csNGAzcHL0CnIFuFgvo7CLKOZOWlA+dT5MKOXV056hrUZVwuLP+uC/zXLUR2g7Jq/DgoNbLbdb9X8NQ7mACl2DeGLHSMtsruKn9OJQ0tveDQhwQK5acX0Px0K/IwCSb0HohfAzllo1vZS5Kh0JkO5gLDaI9l0th/SP1NV+4=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

I'm trying to read from xenstore inside of domU in python. In this
example my domid is 4. I can read from inside domU just fine from the
command line but not using the xs API from python even with correct

root@xen1:~# xenstore-read /local/domain/4/name
root@xen1:~# python test.py
Traceback (most recent call last):
  File "test.py", line 6, in <module>
    xs = xshandle()
  File "/usr/lib/python2.5/site-packages/xen/xend/xenstore/xsutil.py",
line 18, in xshandle
    xs_handle = xen.lowlevel.xs.xs()
xen.lowlevel.xs.Error: (2, 'No such file or directory')

test.py is:
#!/usr/bin/env python

from xen.xend.xenstore.xstransact import *
from xen.xend.xenstore.xsutil import *

xs = xshandle()
th = xs.transaction_start()
print xs.read(th, "/local/domain/4/name")

This code works fine in dom0. I've found that if i do xenstore-read -s
it will give me the same No such file or directory error. The -s
parameter forces xenstore-read to call xs_daemon_open() instead of
xs_domain_open(). The python lowlevel xs file always calls
xs_daemon_open(). Is this the issue? What is the difference between
daemon and domain_open?

Also just to test, I tried to run xend inside domU. Xend fails with an
operation not permitted error, but then when I run test.py after that
I get a Connection Refused error instead of No such file or directory.
Not sure what is going on. I'm using Ubuntu 7.10 with Xen 3.1.0 from
their prebuilt packages.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.