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] Add bindings for xs_get_domain_path().

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Add bindings for xs_get_domain_path().
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 16 Sep 2005 23:56:13 +0000
Delivery-date: Fri, 16 Sep 2005 23:54:58 +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 931526414a644fc467a749a2f957f0c95b6c65f4
# Parent  6a48f88101d3fc8aa591b171f66b091fd4fb35e6
Add bindings for xs_get_domain_path().
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r 6a48f88101d3 -r 931526414a64 tools/python/xen/lowlevel/xs/xs.c
--- a/tools/python/xen/lowlevel/xs/xs.c Fri Sep 16 20:12:42 2005
+++ b/tools/python/xen/lowlevel/xs/xs.c Fri Sep 16 22:27:04 2005
@@ -812,6 +812,48 @@
     return val;
 }
 
+#define xspy_get_domain_path_doc "\n"                  \
+       "Return store path of domain.\n"                \
+       " domid [int]: domain id\n"                     \
+       "\n"                                            \
+       "Returns: [string] domain store path.\n"        \
+       "         None if domid doesn't exist.\n"       \
+       "Raises RuntimeError on error.\n"               \
+       "\n"
+
+static PyObject *xspy_get_domain_path(PyObject *self, PyObject *args,
+                                     PyObject *kwds)
+{
+    static char *kwd_spec[] = { "domid", NULL };
+    static char *arg_spec = "i";
+    int domid = 0;
+
+    struct xs_handle *xh = xshandle(self);
+    char *xsval = NULL;
+    PyObject *val = NULL;
+
+    if (!xh)
+        goto exit;
+    if (!PyArg_ParseTupleAndKeywords(args, kwds, arg_spec, kwd_spec,
+                                     &domid))
+        goto exit;
+    Py_BEGIN_ALLOW_THREADS
+    xsval = xs_get_domain_path(xh, domid);
+    Py_END_ALLOW_THREADS
+    if (!xsval) {
+        if (errno == ENOENT) {
+            Py_INCREF(Py_None);
+            val = Py_None;
+        } else
+            PyErr_SetFromErrno(PyExc_RuntimeError);
+        goto exit;
+    }
+    val = PyString_FromString(xsval);
+    free(xsval);
+ exit:
+    return val;
+}
+
 #define xspy_fileno_doc "\n"                                   \
        "Get the file descriptor of the xenstore socket.\n"     \
        "Allows an xs object to be passed to select().\n"       \
@@ -858,6 +900,7 @@
      XSPY_METH(release_domain),
      XSPY_METH(close),
      XSPY_METH(shutdown),
+     XSPY_METH(get_domain_path),
      XSPY_METH(fileno),
      { /* Terminator. */ },
 };
diff -r 6a48f88101d3 -r 931526414a64 tools/python/xen/xend/xenstore/xsutil.py
--- a/tools/python/xen/xend/xenstore/xsutil.py  Fri Sep 16 20:12:42 2005
+++ b/tools/python/xen/xend/xenstore/xsutil.py  Fri Sep 16 22:27:04 2005
@@ -18,3 +18,6 @@
 
 def IntroduceDomain(domid, page, port, path):
     return xshandle().introduce_domain(domid, page, port, path)
+
+def GetDomainPath(domid):
+    return xshandle().get_domain_path(domid)

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Add bindings for xs_get_domain_path()., Xen patchbot -unstable <=