From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean Guyader Subject: [PATCH 3/3] qemu: xenstore-raw-access Date: Thu, 16 Jul 2009 14:28:16 +0100 Message-ID: <20090716132816.GD16500@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="raC6veAxrt5nqIoY" 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 --raC6veAxrt5nqIoY Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Signed-off-by: Jean Guyader --raC6veAxrt5nqIoY Content-Type: text/plain; charset="us-ascii" Content-Disposition: attachment; filename="xenstore-raw-access.patch" 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)); +} --raC6veAxrt5nqIoY Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --raC6veAxrt5nqIoY--