WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Move xshandle to xsutil.py, add IntroduceDomain, fix lis

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Move xshandle to xsutil.py, add IntroduceDomain, fix list to handle empty/non-existant directories and fix Remove.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 13 Sep 2005 17:50:11 +0000
Delivery-date: Tue, 13 Sep 2005 17:48:43 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Move xshandle to xsutil.py, add IntroduceDomain, fix list to handle empty/non-existant directories and fix Remove., Xen patchbot -unstable <=