From: "Kareem Dana" Subject: python xs.read/write in domU Date: Tue, 19 Feb 2008 11:00:31 -0500 Message-ID: <3bb76bfe0802190800p54071d5p127c3166a84d3b5c@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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 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