aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ocaml/xenstored
Commit message (Collapse)AuthorAgeFilesLines
* oxenstored: Protect oxenstored from malicious domains.=John Liu2013-07-224-5/+26
| | | | | | | | | | | | | | | add check logic when read from IO ring, and if error happens, then mark the reading connection as "bad", Unless vm reboot, oxenstored will not handle message from this connection any more. xs_ring_stubs.c: add a more strict check on ring reading connection.ml, domain.ml: add getter and setter for bad flag process.ml: if exception raised when reading from domain's ring, mark this domain as "bad" xenstored.ml: if a domain is marked as "bad", do not handle it. Signed-off-by: John Liu <john.liuqiming@huawei.com> Acked-by: David Scott <dave.scott@eu.citrix.com>
* ocaml: eventchn: add a 'type t' to represent an event channelDavid Scott2013-04-113-12/+24
| | | | | | | | | | | | | | It's a common OCaml convention to add a 'type t' in a module to represent the main "thing" that the module is about. We add an opaque type t and to_int/of_int functions for those who really need it, in particular: 1. to_int is needed for debug logging; and 2. both to_int and of_int are needed for anyone who communicates a port number through xenstore. Signed-off-by: David Scott <dave.scott@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* oxenstored: Allow oxenstored to use syslog at levels other than DebugDavid Scott2013-03-191-17/+17
| | | | | | | | | | | | | | | | | We now log different kinds of events at different levels. The convention is now: new/end_connection: Debug coalesce: Debug conflict: Debug commit: Debug regular ops: Info start/end_transaction: Debug error (ENOENT): Debug error (any other): Warn watch: Info Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
* oxenstored: enable logging via syslog, if specified in the config file.David Scott2013-03-192-34/+94
| | | | | | | | | | | | | | | | | To log to files the config file should contain: xenstored-log-file = /var/log/xenstored.log access-log-file = /var/log/xenstored-access.log (These two files are still the built-in defaults. The log format is unchanged.) To log to syslog the config file should contain: xenstored-log-file = syslog:<facility> access-log-file = syslog:<facility> where <facility> is the syslog facility to use (e.g. 'daemon' 'local2') Signed-off-by: David Scott <dave.scott@eu.citrix.com>
* oxenstored: Re-add ocaml syslog bindingDavid Scott2013-03-194-2/+147
| | | | | | | | | This was lost in the OCaml xenstored log merge of 10/Oct/2011. The binding isn't exported as a shared "log" library, instead it is kept local to xenstored. Signed-off-by: David Scott <dave.scott@eu.citrix.com>
* oxenstored: Fix spelling of "persistent" config variableIan Jackson2012-02-202-2/+2
| | | | | | | | | Change "persistant" to "persistent", in the code and the example/default config. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* oxenstored: Always log something at start of day (if logging enabled at all)Ian Campbell2011-12-152-3/+3
| | | | | | | | | | | Otherwise at the default level we rarely log anything at all. A completely empty log file is a good sign, but only if you know you are looking in the right place... 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>
* oxenstored: install configuration fileIan Campbell2011-12-154-4/+6
| | | | | | | | | | | | First though: - Move it to /etc/xen/oxenstored.conf. - Use /var/run/xenstored.pid as default pid file - Disable test-eagain "Randomly failed a transaction with EAGAIN. Used for testing Xs user". Doesn't sound fun by default... 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>
* oxenstored: handle unknown operations by returning an error to the clientIan Campbell2011-12-153-4/+4
| | | | | | | | | | | | | | | | | | | Previous an unknown operation would be decoded as a Not_found exception which would bubble all the way up to the try ... with surrounding the call to main_loop where it would be logged and ignored. This would leave the guest hanging waiting for a response to the invalid request. Instead introduce a specific "Invalid" operation. Higher level functionality, such as Process.process_packet, already handles operations which are not understood with an error reply due to the final wildcard entry in Process.function_of_type but explicitly handle Invalid this way to make it clear what is going on. 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>
* oxenstored: log Errors and Warnings by default.Ian Campbell2011-12-091-1/+1
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools/ocaml: Remove log library from tools/ocaml/libsJon Ludlam2011-10-1013-196/+235
| | | | | | | | | | The only user was oxenstored, which has had the relevant bits merged in. Signed-off-by: Zheng Li <zheng.li@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
* tools/ocaml: Remove the uuid libraryJon Ludlam2011-10-101-2/+0
| | | | | | | | | The library was only minimally used, and was really rather redundant. Signed-off-by: Zheng Li <zheng.li@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
* tools/ocaml: Rename the ocaml librariesJon Ludlam2011-10-1012-118/+118
| | | | | | | | | | | | | | | | | | | | ocamlfind does not support namespaces, so to avoid name clashes the module names have become longer. Additionally, the xenstore and xenbus subdirs, which contain several modules each, have been packed into toplevel Xenstore and Xenbus modules. xb becomes xenbus, xc becomes xenctrl, xl becomes xenlight, xs becomes xenstore, eventchn becomes xeneventchn and mmap becomes xenmmap. [ Patch modified from that submitted, to update the .hgignore, and to cope with intervening changes to mmap_stubs.c -iwj ] Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* build: Make XEN_ROOT an absolute path.Keir Fraser2011-03-171-2/+2
| | | | | | | | Otherwise make can search the path relative to certain standard paths such as /usr/include (e.g., the line '-include $(XEN_ROOT)/.config' in Config.mk suffers from this). Signed-off-by: Keir Fraser <keir@xen.org>
* ocaml: evtchn+xc bindings: use libxenctrl and libxenguestIan Campbell2011-01-063-14/+16
| | | | | | | | | | | | | | | | | | | | | | | Now that tools/libxc is licensed under LGPL I don't think there is any need for an LGPL reimplementation under tools/ocaml. For the most part the conversion to the up-to-date libxc API (xc_lib.c essentially implemented the same interface as an older libxc) was pretty automatic. There are some functions which appear to no longer exist in libxc which I therefore simply removed the bindings for and a small number of interfaces which had changed. Many of the functions bound by the stubs have no in-tree users (which I think is fine for a language binding) so I have no way to confirm correctness other than by eye. I was however able to confirm that oxenstored still worked and to build a XCP toolstack which could successfully start a PV guest. Uses the new XC_OPENFLAG_NON_REENTRANT option to avoid potential conflicts between pthreads and the ocaml runtime. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Vincent Hanquez <Vincent.Hanquez@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* ocaml: rename Evtchn.bind_virq as Evtchn.bind_dom_exc_virqIan Campbell2011-01-062-3/+3
| | | | | | | | Rename Evtchn.bind_virq as Evtchn.bind_dom_exc_virq to reflect its actual behaviour. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* ocaml: install built modulesIan Campbell2010-11-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the install target was having no effect because it ended up calling the default target in the subdir Makefile instead of the install target. Resolve this by tying the tools/ocaml Makefiles into the generic handling done by tools/Rules.mk. Other changes arising in one way or another from this: - Add libs/xl/META.in - Update .hgignore for META files - Create leading directories - Remove existing module before installation in install targer (worksaround what appears to be a quirk of "ocamlfind install") - Use the globally defined $(DESTDIR) - Move "ocamlfind printfconf destdir" to a common variable, repurposing exising unused OCAMLDESTDIR, incorporating $(DESTDIR) at the same time. - Drop a few unused variabe definitions (mainly to avoid deciding if $(DESTDIR) made sense for them or not. - Pass -destdir to ocamlfind in uninstall target for symmetry with install target. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* oxenstored: when reading / read automatically the root node.Vincent Hanquez2010-09-101-1/+6
| | | | Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
* ocaml: NetBSD support and general CFLAGS cleanupKeir Fraser2010-05-071-0/+1
| | | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* ocam: add missing files that got lost in the v2 shuffleKeir Fraser2010-05-073-0/+372
| | | | Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
* ocaml: Add xenstored implementation.Keir Fraser2010-05-0621-0/+3220
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>