aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_xshelp.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-01-08 11:46:17 +0000
committerKeir Fraser <keir.fraser@citrix.com>2010-01-08 11:46:17 +0000
commit1bb7406a32c4c10b37abf90a94bff3edd303ebb7 (patch)
treedb960e43e515ee42206c5b2efb0d1f664fc7f493 /tools/libxl/libxl_xshelp.c
parent59d9a14fc638469ed1803004108bcd9085c46e5b (diff)
downloadxen-1bb7406a32c4c10b37abf90a94bff3edd303ebb7.tar.gz
xen-1bb7406a32c4c10b37abf90a94bff3edd303ebb7.tar.bz2
xen-1bb7406a32c4c10b37abf90a94bff3edd303ebb7.zip
libxenlight: don't use the cloning logic in dm_xenstore_record_pid.
use call to lowlevel functions to do the same things. Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_xshelp.c')
-rw-r--r--tools/libxl/libxl_xshelp.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/libxl/libxl_xshelp.c b/tools/libxl/libxl_xshelp.c
index 87c494a4a5..3c065a067b 100644
--- a/tools/libxl/libxl_xshelp.c
+++ b/tools/libxl/libxl_xshelp.c
@@ -23,6 +23,25 @@
#include "libxl.h"
#include "libxl_internal.h"
+int xs_writev(struct xs_handle *xsh, xs_transaction_t t, char *dir, char *kvs[])
+{
+ char *path;
+ int i;
+
+ if (!kvs)
+ return 0;
+
+ for (i = 0; kvs[i] != NULL; i += 2) {
+ asprintf(&path, "%s/%s", dir, kvs[i]);
+ if (path) {
+ int length = strlen(kvs[i + 1]);
+ xs_write(xsh, t, path, kvs[i + 1], length);
+ free(path);
+ }
+ }
+ return 0;
+}
+
char **libxl_xs_kvs_of_flexarray(struct libxl_ctx *ctx, flexarray_t *array, int length)
{
char **kvs;