diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2005-09-23 14:25:01 +0100 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2005-09-23 14:25:01 +0100 |
commit | f11f68cd1157d84615621edcd7321a6d0a09b158 (patch) | |
tree | becbcc239c8b8c0f26e08428b4ac798fa5bdb4fc /tools/xenstore/xs_lib.c | |
parent | 7c7896249b7ffa3a0e6c1c749c8c3b08edf2ae70 (diff) | |
download | xen-f11f68cd1157d84615621edcd7321a6d0a09b158.tar.gz xen-f11f68cd1157d84615621edcd7321a6d0a09b158.tar.bz2 xen-f11f68cd1157d84615621edcd7321a6d0a09b158.zip |
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.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'tools/xenstore/xs_lib.c')
-rw-r--r-- | tools/xenstore/xs_lib.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/tools/xenstore/xs_lib.c b/tools/xenstore/xs_lib.c index 5eb7fada6e..a469578993 100644 --- a/tools/xenstore/xs_lib.c +++ b/tools/xenstore/xs_lib.c @@ -50,6 +50,13 @@ static const char *xs_daemon_path(void) return buf; } +const char *xs_daemon_tdb(void) +{ + static char buf[PATH_MAX]; + sprintf(buf, "%s/tdb", xs_daemon_rootdir()); + return buf; +} + const char *xs_daemon_socket(void) { return xs_daemon_path(); @@ -66,24 +73,6 @@ const char *xs_daemon_socket_ro(void) return buf; } -const char *xs_daemon_store(void) -{ - static char buf[PATH_MAX]; - if (snprintf(buf, PATH_MAX, "%s/store", - xs_daemon_rootdir()) >= PATH_MAX) - return NULL; - return buf; -} - -const char *xs_daemon_transactions(void) -{ - static char buf[PATH_MAX]; - if (snprintf(buf, PATH_MAX, "%s/transactions", - xs_daemon_rootdir()) >= PATH_MAX) - return NULL; - return buf; -} - const char *xs_domain_dev(void) { char *s = getenv("XENSTORED_PATH"); |