aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstore/xenstored_core.h
Commit message (Collapse)AuthorAgeFilesLines
* Switch to poll() in cxenstored's IO loopWei Liu2013-04-111-0/+2
| | | | | | | | | | | | | | | | | Poll() can support more file descriptors than select(). We've done this for xenconsoled, now do this for cxenstored as well. The code is taken from xenconsoled and modified to adapt to cxenstored. Note that poll() semantic is a bit different from select(). In Linux, if a fd is set in IN/OUT fd_set and error occurs inside select(), this fd is still considered readable / writable, and it is set in the returned IN/OUT fd_set. So in later handle_input / handle_output, the connection will eventually be talloc_free'ed(). After switching to poll(), we should take care of any error right away, making the code clearer. Signed-off-by: Wei Liu <wei.liu2@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* 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: add --priv-domid parameterDaniel De Graaf2012-02-091-0/+1
| | | | | | | | | | | | This parameter identifies an alternative service domain which has superuser access to the xenstore database, which is currently required to set up a new domain's xenstore entries. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Campbell <ian.campbell@citrix.com> Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* xenstored: add --event parameter for bootstrappingDaniel De Graaf2012-02-091-0/+3
| | | | | | | | | | | | When xenstored is run in a minios domain, it needs a bootstrap connection to dom0 so that additional domain introduce messages can be sent to it. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Campbell <ian.campbell@citrix.com> Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* xenstored: support running in minios stubdomDaniel De Graaf2012-02-091-0/+12
| | | | | | | | | | | | | A previous versions of this patch has been sent to xen-devel. See http://lists.xensource.com/archives/html/xen-devel/2009-03/msg01655.html Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com> Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Campbell <ian.campbell@citrix.com> Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* Add DTrace support to xenstoredKeir Fraser2008-01-311-1/+1
| | | | | | | Add USDT probes for significant xenstore operations to allow dynamic tracing. Signed-off-by: John Levon <john.levon@sun.com>
* New XS_SET_TARGETKeir Fraser2008-01-231-0/+3
| | | | | | | | | | | Stubdomains (and probably other domain disagregation elements too) need to be able to tinker with another domain. This adds XS_SET_TARGET so that XenStore allows domains to have permissions on files on which the "target" has permissions. This also adds xs_set_target, called by the domain builder when the 'target' option is used in the configuration. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* [SOLARIS] Create kernel-interface implementations for libxc and xenstored.kfraser@localhost.localdomain2006-10-171-0/+3
| | | | | | Additionally, on Solaris, tell the kernel when xenstored is running. Signed-off-by: John Levon <john.levon@sun.com>
* Add a transaction_started field in xenstored connection structure instead ofvhanquez@gwig.uk.xensource.com2006-07-311-0/+1
| | | | | | | | browsing the list of transaction each time Bump the default to 10, and make it configurable through the command line. Signed-off-by: Vincent Hanquez <vincent@xensource.com>
* [XENSTORE] Make use of /proc/xen/xsd_{port,kva} private to the Linux ↵kaf24@firebug.cl.cam.ac.uk2006-05-241-0/+8
| | | | | | | implementation. Signed-off-by: John Levon <john.levon@sun.com>
* Added a basic integrity checker, and some basic ability to recover from storeemellor@leeni.uk.xensource.com2006-03-021-4/+0
| | | | | | | | | | | corruption, rather than just spewing error messages and exiting. Added a xenstore-control executable, which sends commands to xenstored. Currently, the only command is 'check', which triggers an integrity check. (The integrity check is also triggered whenever a corrupted store is detected). Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Change the semantics of GetDomainPath so that it always succeeds, regardless ofemellor@leeni.uk.xensource.com2005-10-231-3/+0
| | | | | | | | | | | | | | | | | | | | | whether a domain has been introduced to the store. Added a separate message XS_IS_DOMAIN_INTRODUCED and API for that (xs_is_domain_introduced) to determine whether the domain has really been introduced. This change means that the tools can determine the correct domain path earlier in the domain creation process, which is particularly a factor with live migration, as it allows us to create the devices earlier in the process, and unpause the new domain before performing the introduce. Until recently we already had these features, but the simplification of the interface between xend and xenstored caused breakage. No longer clear out the domain path when a domain is introduced -- this was a hack to work around the recent problematic semantics of GetDomainPath. Do not write the contents of the info block to the store. All the configuration info is written to the /vm path, and anything else in the info block is either dealt with explicitly or is ephemeral and has no place in the store. Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Take advantage of the new UUID (handle) stored for us in Xen to improve theemellor@leeni.uk.xensource.com2005-10-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | recreation semantics. Remove the unpause at the end of xc_linux_restore, and move it to XendDomainInfo. This is necessary because xenstored now allocates the domain path when the domain is introduced, which means that the new domain cannot start running until that introduce is performed and the new devices configured. Give restore a separate completion phase in which domain details are stored. This is required because the domain path is no longer available until after the introduceDomain call. TODO: Split the domain introduction into two so that the domain path is available earlier. At the moment, the domain <-> store channel details are passed in to xenstored when the domain is introduced, but in the case of restore it is necessary to wait until the restore is completed before the channel MFN is available. Change the interface between XendDomainInfo and XendCheckpoint/image to not have hideous callbacks through setConsoleRef and setStoreRef. Instead, image.createImage explicitly returns those values, and XendCheckpoint passes them through to completeRestore. Move the purging of the domain path corresponding to a new domain from Xend to xenstored, since xenstored is now in charge of this path. With the domain path creation moved to xenstored, Xend cannot remove the path, because watches may have fired on it already. Fix the printf statement in xenstored in verbose mode that details the messages being written. This statement was printing the buffer using %s, but this buffer has an explicit length field, so we were seeing garbage after the correct details. Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Fix Xen public interfaces and the tools to consistentlykaf24@firebug.cl.cam.ac.uk2005-10-121-2/+2
| | | | | | | | use stdint-format bitsize types (uint32_t and friends). Signed-off-by: Keir Fraser <keir@xensource.com>
* xenstored now supports multiple concurrent transactions perkaf24@firebug.cl.cam.ac.uk2005-10-101-1/+5
| | | | | | | | | | | | | | | | | | | | connection, plus interleaving of transactional and non-transactional accesses. A transaction identifier is added to the xsd_sockmsg header structure (0 means 'not in context of a transaction'). The user and kernel xs interfaces accept a pointer to a transaction handle where appropriate -- currently this is directly cast to an integer identifier in the client library / kernel driver, but will allow for keeping extra dynamic client-side state in future if we need to. The transaction mutex has now gone. It's replaced with a read-write mutex, but this is only acquired for exclusive access during suspend/resume, to ensure there are no in-progress transactions. Signed-off-by: Keir Fraser <keir@xensource.com>
* Simplify reply logic in xenstored. Maintain a linked listkaf24@firebug.cl.cam.ac.uk2005-10-091-16/+17
| | | | | | | | | | | | | | | | | 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-3/+0
| | | | | | | | | to fire concurrently with request/reply pairs. Remove watch_ack message: no longer needed. Signed-off-by: Keir Fraser <keir@xensource.com>
* Rationalise xenstore header files a little. xenstored.h,kaf24@firebug.cl.cam.ac.uk2005-10-071-1/+0
| | | | | | | | | | | which defines aspects of the 'wire' protocol between xs daemon and clients in user and kernel land, is now xs_wire.h and moved to xen's public/io directory. From there it is more easily accessible by kernels. Signed-off-by: Keir Fraser <keir@xensource.com>
* User tools send evtchn notifications via /dev/xen/evtchnkaf24@firebug.cl.cam.ac.uk2005-10-061-0/+2
| | | | | | | | rather than using hypercall directly. Signed-off-by: Keir Fraser <keir@xensource.com>
* Make xenstored use tdb, transactions can soft-fail (EAGAIN)Rusty Russell2005-09-231-31/+35
| | | | | | | | | | | | | | 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>
* Add @introduceDomain event-watch and replace consoled watch on /console.cl349@firebug.cl.cam.ac.uk2005-09-051-0/+3
| | | | | Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* 1) More testing: include tests which I forgot in previous patch, removekaf24@firebug.cl.cam.ac.uk2005-08-081-1/+3
| | | | | | | | | | | | | | | | | | | xs_watch_stress, reduce cycles in "make check" random test. 2) xs_crashme: corrupt random packets going to xenstored, watch it crash. 3) Handle second input from before we finished output on first one. 4) Fix bug where one-arg operations are given zero args. 5) Fix bug where SET_PERMS fails after blocking on transaction. 6) Fix memory leak when DIRECTORY op given no argument. 7) Fail on first memory leak, for better testing. 8) Fix missing waiting_for_ack initialization for new connections. 9) Ensure all input and output is handled for domains so we don't stall. 10) Fix overrun bug in xs_count_strings on non-nul-terminated strings. 11) New test for clients which write without waiting for response. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* Remove ill-conceived concept of watches blocking reply oncl349@firebug.cl.cam.ac.uk2005-07-261-8/+0
| | | | | | | | | | | | | 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-0/+1
| | | | | | | 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-0/+12
| | | | | | | | | | | | 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-6/+17
| | | | | | | | | | 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-1/+1
| | | | | | | | | 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-0/+5
| | | | | | | | | | - 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.1748 (42bbc14djIjScNrLp20eDhlxUjQl4g)cl349@firebug.cl.cam.ac.uk2005-06-241-0/+11
| | | | | | | | | | | xenstored_transaction.c, xenstored_core.h, xenstored_core.c, TODO: Update TODO list Wrap opendir in talloc so it gets cleaned up on OOM. Remove last call to system by open-coding "cp -al" to create transaction. Signed-off-by: Rusty Russell <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-5/+14
| | | | | | | | | | | | | | | | | | | 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.1705.1.15 (42a9af28Mzva9Shzn8gUSiuJSM-TbA)kaf24@firebug.cl.cam.ac.uk2005-06-101-0/+3
| | | | | xenstore fixes for read-only connections.
* bitkeeper revision 1.1662.1.15 (42a5968eiZE_DjdIFPjxvzLw6ACvCQ)cl349@firebug.cl.cam.ac.uk2005-06-071-0/+123
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>