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

[Xen-changelog] Move xshandle to xsutil.py, add IntroduceDomain, fix list to handle empty/non-existant directories and fix Remove.



# HG changeset patch
# User cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID 68c4eb06a6aa538ce3f318d01541cc032f50fd34
# Parent  c66a660872e7ab730e4e35dc613280530713fca6
Move xshandle to xsutil.py, add IntroduceDomain, fix list to handle 
empty/non-existant directories and fix Remove.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r c66a660872e7 -r 68c4eb06a6aa 
tools/python/xen/xend/xenstore/xstransact.py
--- a/tools/python/xen/xend/xenstore/xstransact.py      Tue Sep 13 14:45:34 2005
+++ b/tools/python/xen/xend/xenstore/xstransact.py      Tue Sep 13 15:19:39 2005
@@ -7,14 +7,7 @@
 import errno
 import threading
 from xen.lowlevel import xs
-
-handles = {}
-
-# XXX need to g/c handles from dead threads
-def xshandle():
-    if not handles.has_key(threading.currentThread()):
-        handles[threading.currentThread()] = xs.open()
-    return handles[threading.currentThread()]
+from xen.xend.xenstore.xsutil import xshandle
 
 class xstransact:
 
@@ -100,7 +93,10 @@
 
     def _list(self, key):
         path = "%s/%s" % (self.path, key)
-        return map(lambda x: key + "/" + x, xshandle().ls(path))
+        l = xshandle().ls(path)
+        if l:
+            return map(lambda x: key + "/" + x, l)
+        return []
 
     def list(self, *args):
         if len(args) == 0:
@@ -139,7 +135,7 @@
 
     Write = classmethod(Write)
 
-    def Remove(cls, *args):
+    def Remove(cls, path, *args):
         while True:
             try:
                 t = cls(path)
diff -r c66a660872e7 -r 68c4eb06a6aa tools/python/xen/xend/xenstore/xsutil.py
--- /dev/null   Tue Sep 13 14:45:34 2005
+++ b/tools/python/xen/xend/xenstore/xsutil.py  Tue Sep 13 15:19:39 2005
@@ -0,0 +1,20 @@
+# Copyright (C) 2005 Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>
+
+# This file is subject to the terms and conditions of the GNU General
+# Public License.  See the file "COPYING" in the main directory of
+# this archive for more details.
+
+import threading
+from xen.lowlevel import xs
+
+handles = {}
+
+# XXX need to g/c handles from dead threads
+def xshandle():
+    if not handles.has_key(threading.currentThread()):
+        handles[threading.currentThread()] = xs.open()
+    return handles[threading.currentThread()]
+
+
+def IntroduceDomain(domid, page, port, path):
+    return xshandle().introduce_domain(domid, page, port, path)

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


 


Rackspace

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