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

[Xen-changelog] [qemu-xen-unstable] add low level functions from the root (read/write). [PATCH 3/3]



commit 4f947e17894a2e58a02fa6c1c712e7691a179212
Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Date:   Tue Jul 21 15:30:18 2009 +0100

    add low level functions from the root (read/write).  [PATCH 3/3]
    
    This is a series of patch to complete the xenstore interface in qemu.
    
    1: create a callback mecanism for xenstore watches.
    2: add per domain low level xenstore functions (read/chmod/write/watch).
    3: add low level functions from the root (read/write).
    
    Signed-off-by: Jean Guyader <jean.guyader@xxxxxxxxxx>
---
 qemu-xen.h |    3 +++
 xenstore.c |   17 +++++++++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/qemu-xen.h b/qemu-xen.h
index 5e30c61..29b8161 100644
--- a/qemu-xen.h
+++ b/qemu-xen.h
@@ -101,6 +101,9 @@ int xenstore_dom_write(int domid, const char *key, const 
char *value);
 void xenstore_dom_watch(int domid, const char *key, xenstore_callback ftp, 
void *opaque);
 void xenstore_dom_chmod(int domid, const char *key, const char *perms);
 
+char *xenstore_read(const char *path);
+int xenstore_write(const char *path, const char *val);
+
  /* `danger' means that this parameter, variable or function refers to
   * an area of xenstore which is writeable by the guest and thus must
   * not be trusted by qemu code.  For variables containing xenstore
diff --git a/xenstore.c b/xenstore.c
index 1ad6dc9..bb5f848 100644
--- a/xenstore.c
+++ b/xenstore.c
@@ -1562,3 +1562,20 @@ int xenstore_dom_write(int domid, const char *key, const 
char *value)
     free(buf);
     return rc;
 }
+
+char *xenstore_read(const char *path)
+{
+    char *value = NULL;
+    unsigned int len;
+
+    if (xsh == NULL)
+        return NULL;
+    return xs_read(xsh, XBT_NULL, path, &len);
+}
+
+int xenstore_write(const char *path, const char *val)
+{
+    if (xsh == NULL)
+        return 1;
+    return xs_write(xsh, XBT_NULL, path, val, strlen(val));
+}
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

_______________________________________________
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®.