aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstore/xenstore_client.c
diff options
context:
space:
mode:
authoremellor@ewan <emellor@ewan>2005-09-23 14:28:16 +0100
committeremellor@ewan <emellor@ewan>2005-09-23 14:28:16 +0100
commitbdd477ad345e8e0ba6640ea480fa47a7c3d5fdf0 (patch)
treee8fc323b3f0330ac42ee57f9cc8bb740baabcc9f /tools/xenstore/xenstore_client.c
parentf11f68cd1157d84615621edcd7321a6d0a09b158 (diff)
downloadxen-bdd477ad345e8e0ba6640ea480fa47a7c3d5fdf0.tar.gz
xen-bdd477ad345e8e0ba6640ea480fa47a7c3d5fdf0.tar.bz2
xen-bdd477ad345e8e0ba6640ea480fa47a7c3d5fdf0.zip
Add check for speed (takes 33 minutes on my laptop, OUCH!)
Make xenstored use tdb, transactions can soft-fail (EAGAIN) Transactions no longer take root dir, no longer lock & block: commit can fail spuriously with EAGAIN, not ETIMEDOUT. Speeds up transactions by over 1000 times, should be NFS safe. New program: xs_tdb_dump to dump raw TDB contents. Don't do failure testing: we are no longer robust against all ENOMEM 8( Introduce "struct node" which contains perms, children and data. Make struct xs_permissions unpadded, so we can write to tdb w/o valgrind complaints. Gently modify TDB to use talloc, not do alloc on tdb_delete. Fix up transaction users for new semantics. Don't need a transaction around a single read in xen/i386/kernel/smpboot.c. Python: transaction_start() returns True/False rather than raising exception on EAGAIN. Fix usage comment on xs_transaction_end(). Include stdarg to xs_tdb_dump so it compiles. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'tools/xenstore/xenstore_client.c')
-rw-r--r--tools/xenstore/xenstore_client.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/xenstore/xenstore_client.c b/tools/xenstore/xenstore_client.c
index 8b6ed4a245..ef428f9acb 100644
--- a/tools/xenstore/xenstore_client.c
+++ b/tools/xenstore/xenstore_client.c
@@ -14,6 +14,7 @@
#include <stdlib.h>
#include <string.h>
#include <xs.h>
+#include <errno.h>
static void
usage(const char *progname)
@@ -82,8 +83,8 @@ main(int argc, char **argv)
}
#endif
- /* XXX maybe find longest common prefix */
- success = xs_transaction_start(xsh, "/");
+ again:
+ success = xs_transaction_start(xsh);
if (!success)
errx(1, "couldn't start transaction");
@@ -145,8 +146,10 @@ main(int argc, char **argv)
out:
success = xs_transaction_end(xsh, ret ? true : false);
- if (!success)
+ if (!success) {
+ if (ret == 0 && errno == EAGAIN)
+ goto again;
errx(1, "couldn't end transaction");
-
+ }
return ret;
}