Xen 
 
Home About Xen.org Xen Xen Summit Wiki Mailing List Bug Tracker Xen Downloads
 
   
 

xen-devel

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

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] python xs.read/write in domU
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
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=8EsShKMlRH+VSOR5sQc5IbQDaXhM2yRmw5FS+6aU/Sk=; b=WiG9w1ah0T6MaFCuMkrnmYVrEZGAiSbvr3/kUcEGbcN6cmj62zoJI2UmlXZK8jPxqKYJMRlV1tRWieDfW/UeZpNJJ8kkqflmjzH2U3cGeHLLHOAoI594A9/txdYuaDb46FU1jqmGRfZFiDZg8ZQUiAtkC4eWhk7+3JapOLJ1KQA=
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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
permissions.

root@xen1:~# xenstore-read /local/domain/4/name
xen1.numnum.net
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")
xs.transaction_end(th)
#xstransact.Read("/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.

Thanks
Kareem

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>