All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Guyader <jean.guyader@citrix.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH 3/3] qemu: xenstore-raw-access
Date: Thu, 16 Jul 2009 14:28:16 +0100	[thread overview]
Message-ID: <20090716132816.GD16500@citrix.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 54 bytes --]

Signed-off-by: Jean Guyader <jean.guyader@citrix.com>

[-- Attachment #2: xenstore-raw-access.patch --]
[-- Type: text/plain, Size: 1251 bytes --]

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));
+}

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

                 reply	other threads:[~2009-07-16 13:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090716132816.GD16500@citrix.com \
    --to=jean.guyader@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.