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@citrix.com>
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
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));
+}