aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstore/xenstored_watch.c
Commit message (Collapse)AuthorAgeFilesLines
* nstore: rename public xenstore headersIan Campbell2012-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | The xenstore header xs.h is producing conflicts with other software[1]. xs is a too short identifier and does not matche the library. Renaming the headers to xenstore.h and xenstore_lib.h is the easiest way to make them easy recognizable and prevent furthe problems. [1]: http://bugs.debian.org/668550 [ Also update QEMU_TAG, to bring in corresponding change to qemu-xen-traditional. -iwj ] Signed-off-by: Bastian Blank <waldi@debian.org> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com> --HG-- rename : tools/xenstore/xs.h => tools/xenstore/xenstore.h rename : tools/xenstore/xs_lib.h => tools/xenstore/xenstore_lib.h
* xenstored: return EINVAL for attempt to watch invalid pathIan Campbell2010-10-211-1/+1
| | | | | | | errno is essentially random at this point. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xenstore: fix canonicalize for metanodesKeir Fraser2008-04-091-1/+1
| | | | Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* xenstore size limitsKeir Fraser2007-12-141-0/+4
| | | | | | | | | | | | | | | * Documents the existing 4kby size limit on xenstore message payloads * Causes xs.c in libxenstore to fail locally rather than violating said limit (which is good because xenstored kills the client connection if it's exceeded). * Introduces some limits on path lengths in xenstored. I trust no-one is using path lengths >2kby. This is good because currently a domain client can create a 4kby relative path that the dom0 tools cannot access since they'd have to specify the somewhat longer absolute path. * Removes uses of the host's PATH_MAX (!) Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Fire watch for non-dom0 backend when frontend is removed from xenstoreKeir Fraser2007-10-261-1/+10
| | | | | in a transaction. Signed-off-by: Max Zhen <max.zhen@sun.com>
* Fix xenstore unwatch with node name starting with "@"Keir Fraser2007-10-171-1/+1
| | | | | Watch node starting with "@" should not be canonicalized. Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
* xenstore: Small cleanups and fixes.kfraser@localhost.localdomain2007-07-241-3/+2
| | | | | | | | 1. readfd/writefd account for EINTR/EAGAIN errno returns. 2. Handle zero return from ->read() and ->write() handlers symmetrically. 3. Fix some indentation issues (use hard tabs). Signed-off-by: Keir Fraser <keir@xensource.com>
* xenstore: Remove broken and unmaintained test code.kfraser@localhost.localdomain2007-07-031-12/+0
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Fully reset the xenstore connection when a domain is (re)introduced to ↵kfraser@localhost.localdomain2007-03-011-0/+11
| | | | | | xenstored. Signed-off-by: Keir Fraser <keir@xensource.com>
* add quota to xenstored.vhanquez@kneesa.uk.xensource.com2006-04-131-0/+9
| | | | | Signed-off-by: Vincent Hanquez <vincent@xensource.com>
* Simplify reply logic in xenstored. Maintain a linked listkaf24@firebug.cl.cam.ac.uk2005-10-091-66/+21
| | | | | | | | | | | | | | | | | of pending replies that are sent out in order. Currently we only read new requests when the reply list is empty. In fact there is no good reason for this restriction. Another interesting point is that (on my test machine) hotplug blk setup fails if xenstored_client connects to xenstored via the unix domain socket rather than through the kernel --- this points to some user/kernel races that are 'fixed' by the extra serialisation of the in-kernel mutexes. It definitely needs looking into. Signed-off-by: Keir Fraser <keir@xensource.com>
* Refactor xenbus to break up the xenbus_lock and permit watcheskaf24@firebug.cl.cam.ac.uk2005-10-091-45/+11
| | | | | | | | | to fire concurrently with request/reply pairs. Remove watch_ack message: no longer needed. Signed-off-by: Keir Fraser <keir@xensource.com>
* Make xenstored use tdb, transactions can soft-fail (EAGAIN)Rusty Russell2005-09-231-60/+19
| | | | | | | | | | | | | | 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>
* Fire watches once immediately upon registration.cl349@firebug.cl.cam.ac.uk2005-09-191-0/+3
| | | | | | | | It matches the model of programming used to avoid races with watches, and also makes re-establishing watches on daemon restart easier. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Fix xenstored watch crash.cl349@firebug.cl.cam.ac.uk2005-09-141-1/+1
| | | | | | | | | When a connection blocked waiting on a transaction, don't queue watch events. Sure, they'd be ignored and re-transmitted, but it hits an assert that we don't send data out blocked connections, and it's wasteful. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (authored) Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Fix up testsuite from recent changes.cl349@firebug.cl.cam.ac.uk2005-09-131-1/+0
| | | | | | | | | | | | | | | (1) Make TESTDIR relative (my directory exceeded 108 chars, breaking sockets) (2) Make TESTDIR if it doesn't exist (3) Add dummy xc_domain_getinfo and xc_evtchn_bind_virq for fake libxc (4) Fix tests broken by b594bb976a743d509f1ffabb5bc698874ab90d8f (5) domain_cleanup() can be static, as it's not used elsewhere. (6) With -Werror, "use" unused variable in domain_init() if TESTING (7) Remove debugging printf on watch without perms. (8) Loosen timeout in xs_test (valgrind + slow machine == bogus timeouts) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (authored) Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Always fire watches, even on the connection which caused the watch to fire.cl349@firebug.cl.cam.ac.uk2005-09-121-4/+1
| | | | | Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Add @releaseDomain watch-event.cl349@firebug.cl.cam.ac.uk2005-09-061-1/+1
| | | | | Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Add @introduceDomain event-watch and replace consoled watch on /console.cl349@firebug.cl.cam.ac.uk2005-09-051-6/+12
| | | | | Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Implement watching of nodes which don't exist.cl349@firebug.cl.cam.ac.uk2005-08-021-4/+13
| | | | | | | | | | | | | Requires permission check every time event is generated. Requires generalization of permissions: ask arbitrary number of parents whether it's OK to tell about node (eg. watching /dir/subdir/x when /dir is deleted: root permissions will now determine whether we fire event). Add test that we don't leak information on whether a file exists or not. Signed-off-by: Rusty Russel <rusty@rustcorp.com.au> Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Remove ill-conceived concept of watches blocking reply oncl349@firebug.cl.cam.ac.uk2005-07-261-16/+5
| | | | | | | | | | | | | connection which did write/mkdir/rm/setperm etc. This causes deadlocks in real life, and I can't see a sane way of avoiding them: it is reasonable for someone to ignore watch notifications while doing other actions, and that means that we can do other writes. These writes can block pending other watchers; if one of these is the process blocked awaiting our ack, we deadlock. Signed-off-by: Rusty Russel <rusty@rustcorp.com.au> Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Fix bug where transaction fires multiple events.cl349@firebug.cl.cam.ac.uk2005-07-261-2/+0
| | | | | | | Add general trace() call to help future debugging. Signed-off-by: Rusty Russel <rusty@rustcorp.com.au> Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Change watches: operations block until everyone has acked.cl349@firebug.cl.cam.ac.uk2005-07-261-196/+95
| | | | | | | | | | | | Watch events are no longer sent to self Watches no longer take a priority async and asyncwait commands for xs_test, now we need to continue despite blocking ops. Print test name at end of verbose run on failure. Use --trace-file arg to xenstored when testing Signed-off-by: Rusty Russel <rusty@rustcorp.com.au> Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Change from bool indicating blocked to an enum: when watches gocl349@firebug.cl.cam.ac.uk2005-07-261-18/+30
| | | | | | | | | | synchronous this makes it easier (because then we have two reasons to block) Instead of using return value, use explicit state member inside struct connection. Signed-off-by: Rusty Russel <rusty@rustcorp.com.au> Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Test and fix acknowedge_watch from returning EINVAL.cl349@firebug.cl.cam.ac.uk2005-07-261-5/+10
| | | | | | | | | Also ensure that daemon re-xmits event if they ack wrong thing (otherwise confused clients get stuck, as we will send no more data while awaiting ack). Signed-off-by: Rusty Russel <rusty@rustcorp.com.au> Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* xenstored updates.cl349@firebug.cl.cam.ac.uk2005-07-121-40/+103
| | | | | | | | | | - add trace file support. - update permissions code. - trigger watches on children of nodes being removed. - update test cases. Signed-off-by: Rusty Russel <rusty@rustcorp.com.au> Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* bitkeeper revision 1.1713.3.5 (42b2a4e2r6SNlC_nq2hAkXEQjEFAmA)cl349@firebug.cl.cam.ac.uk2005-06-171-65/+124
| | | | | | | | | | | | | | | | | | | Many files: - watch now takes a token, returned when reading watch - More tests - Fix domain shared page communication (flush output) - Add "home" path for domains - More permissions checks in various functions - Simplify watch acknowledgement code and fix occasional bug xs_watch_stress.c, 12readonly.sh, 11domain-watch.sh, 10domain-homedir.sh: new file xs_stress.c, xs_lib.h, xs_lib.c: Cleanup whitespace. ignore: Add tools/xenstore/xs_watch_stress Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* bitkeeper revision 1.1662.1.15 (42a5968eiZE_DjdIFPjxvzLw6ACvCQ)cl349@firebug.cl.cam.ac.uk2005-06-071-0/+279
Add xenstore daemon and library. Makefile: Add xenstore subdirectory. Remove xs_stress on clean. Many files: new file ignore: Update ignore list for xenstore. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (authored) Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>