Commit Graph
201 Commits
Author SHA1 Message Date
Ewan Mellor db34d2aaa5 Fix handling of the entries-per-domain quota. Entries which are created by
the guest but deleted by dom0 were remaining accounted against the guest,
which meant that the guest would eventually run out of quota.

This patch also prevents unprivileged domains from changing the owner of a
node.  One guest could attack another by creating nodes and then transferring
them to the ownership of another, and though the accounting could be made to
work properly in this case, domains should never be transferring nodes in any
case, so it seems safer just to disallow the operation entirely.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-11-13 10:43:29 +00:00
kaf24@localhost.localdomain 22ed12a0f3 [XENSTORED] Fix errno 'leak' in xenstored.
In certain cases, when a client doesn't have enough permissions, the
errno variable is not set in xenstored_core.c before its value is
reported back.  As a result, the client can learn about the errno of
the last failed request to xenstored (which could have come from
another client).  (An unintended information channel! :-)

From: Magnus Carlsson <magnus@galois.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-11 01:23:11 +00:00
kfraser@localhost.localdomain 625b3409d2 [XENSTORE] Fix xenstore-ls program to connect via kernel xenbus
connection by default, like all other client utils.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-09 13:25:47 +00:00
kfraser@localhost.localdomain 2004d63d13 Stop enforcing -g for some of the tools.
Signed-off-by: John Levon <john.levon@sun.com>
2006-10-31 18:24:57 +00:00
kfraser@localhost.localdomain 5dfa416d52 Don't use $(LINK.o), as it doesn't pick up -m32/-m64 from $(CFLAGS).
Signed-off-by: John Levon <john.levon@sun.com>
2006-10-19 15:13:09 +01:00
kfraser@localhost.localdomain b9488ab5f5 [SOLARIS] Create kernel-interface implementations for libxc and xenstored.
Additionally, on Solaris, tell the kernel when xenstored is running.

Signed-off-by: John Levon <john.levon@sun.com>
2006-10-17 18:21:25 +01:00
kfraser@localhost.localdomain 2d0b60a90f [SOLARIS] A couple of simple compile fixes for tools/ on Solaris.
Signed-off-by: John Levon <john.levon@sun.com>
2006-10-17 18:15:59 +01:00
kfraser@localhost.localdomain d61113c5c7 [SOLARIS] On Solaris, GCC is configured to use Sun's LD. Fix the build to use
the correct flags, and link against libsocket where necessary.

Signed-off-by: John Levon <john.levon@sun.com>
2006-10-17 17:17:57 +01:00
kfraser@localhost.localdomain 2023a310ed [SOLARIS] A couple of small fixes to the Makefiles for the kernel tool headers.
Signed-off-by: John Levon <john.levon@sun.com>
2006-10-17 16:51:09 +01:00
kfraser@localhost.localdomain 6311dc03da Clean up duplication of 'install' macros in the Makefiles.
Signed-off-by: John Levon <john.levon@sun.com>
2006-10-17 15:57:05 +01:00
Christian Limpach 5292dab2f0 [xenstore] Don't create a transaction for singleton read/write operations.
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-10-12 11:26:07 +01:00
Christian Limpach 88bea76202 [xenstore] Don't limit the number of concurrent transactions for domain0 connections
since both xend and the xenstore-* utilities used in the hotplug
scripts can easily reach the limit and we trust them anyway.

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-10-12 11:25:32 +01:00
kfraser@localhost.localdomain 75205296f9 This is a small patch that makes a cross compiler successfully compile
the sources under the tools directory.  This patch became necessary
after qemu-dm is updated to a newer version.

Signed-off-by: Hiroya INAKOSHI <inakoshi.hiroya@jp.fujitsu.com>
2006-08-16 11:53:37 +01:00
kfraser@localhost.localdomain e70f7a84ee Set the close-on-exec flag on the xenstore fd in libxenstore.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2006-08-15 16:25:39 +01:00
kfraser@localhost.localdomain ae9516f06f [TOOLS] Enhance xenstore-ls to optionally display permissions.
Also perform an ioctl to determine the current width of the terminal.

Signed-off-by: Michael LeMay <mdlemay@epoch.ncsc.mil>
2006-08-02 15:00:39 +01:00
kfraser@localhost.localdomain 219c85a53b [TOOLS] Modify xenstore_client.c to include a new utility, xenstore-chmod.
This utility permits developers and administrators to
manually change the permissions on arbitrary locations in XenStore
from the command line.  This is often helpful if you're trying to debug an
application that relies on XenStore and is encountering difficulties
with permissions.

Signed-off-by: Michael LeMay <mdlemay@epoch.ncsc.mil>
2006-08-02 14:58:37 +01:00
kfraser@localhost.localdomain ad3b5ffb6a [TOOLS] Clean up libxenstore.a on 'make clean'.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-08-01 17:47:21 +01:00
vhanquez@gwig.uk.xensource.com 8d79f14a5d Add a transaction_started field in xenstored connection structure instead of
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>
2006-07-31 09:30:36 +00:00
vhanquez@gwig.uk.xensource.com d763fcc163 Limit the number of opened transactions per connection to 5.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-07-29 14:05:59 +01:00
kfraser@localhost.localdomain ce6dad0068 Add versioning info to xenstore library.
From: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-07-25 15:33:00 +01:00
kfraser@localhost.localdomain bf5226569a The blktap commit reverted the change so that libxenstore gets
installed executable.  :/  Updated patch to fix things again

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-07-25 11:41:18 +01:00
jchesterfield@dhcp92.uk.xensource.com 0da81aa1d4 Added blktap support. Includes kernel driver (enabled as CONFIG_XEN_BLKDEV_TAP=y) and userspace tools. The userspace deamon (blktapctrl) is enabled by default when xend is activated. For further information on using and configuring blktap see tools/blktap/README. 2006-07-13 10:13:26 +01:00
kfraser@localhost.localdomain 27e92b03cf Shared libs have traditionally been installed as executables due to
some
long ago accidents of implementation in historical Unixes.  And there
are various tools which "expect" it (... and this is why they get
created as executable by default by ld).  

Switching to INSTALL_LIB here although I think the whole "define all
the
ways you're going to use install" in this makefile a _smidge_ overkill

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-07-10 17:38:41 +01:00
kaf24@firebug.cl.cam.ac.uk 76f880fe7d [TOOLS] Introduce xc_evtchn_*() interface for interacting with /dev/xen/evtchn.
No longer open the device as non-blocking: all reads immediately follow
a select() on the device indicating it's ready to read.

Signed-off-by: John Levon <john.levon@sun.com>
2006-06-15 13:11:31 +01:00
kaf24@firebug.cl.cam.ac.uk 1ac7d8afca [XENSTORE] Make use of /proc/xen/xsd_{port,kva} private to the Linux implementation.
Signed-off-by: John Levon <john.levon@sun.com>
2006-05-24 14:24:57 +01:00
emellor@leeni.uk.xensource.com 7bc3fa8ada Fix log message written when xenstored corrupts its store.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-05-23 16:17:28 +01:00
vhanquez@kneesa.uk.xensource.com 7e8cc1fb7f dom0 and anonymous connections can create unlimited sized entries in the store.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-05-11 15:51:56 +01:00
vhanquez@kneesa.uk.xensource.com acd5a62ae9 Try to create runtime xenstored's directories at startup time.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-05-11 15:01:54 +01:00
kaf24@firebug.cl.cam.ac.uk 0ff716c0b3 When building with FORTIFY_SOURCE to ensure that return codes of common
functions are checked to avoid some bugs, a few warnings pop up and
become errors due to -Werror.  Attached checks the return codes
(or at least stores them to a dummy variable).

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-04-28 14:08:40 +01:00
vhanquez@kneesa.uk.xensource.com e43071c7b1 add quota to xenstored.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-04-13 16:21:13 +00:00
kaf24@firebug.cl.cam.ac.uk 5c0356ec6f Remove some bogus .PHONY Makefile declarations.
Fixes xentop installation.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-04-11 09:58:04 +01:00
kaf24@firebug.cl.cam.ac.uk b5fa90ac8e build: Clean up use of .PHONY
* Move .PHONY directives next to targets,
  this makes them a lot harder to miss
* Add missing .PHONY directives
* Remove nonexistent .PHONY directives
* Hopefully I didn'T miss anything...

Signed-Off-By: Horms <horms@verge.net.au>
2006-04-10 17:02:49 +01:00
emellor@leeni.uk.xensource.com 7a6ee342c3 Further attempts to recover from a corrupt store, this one triggered when a
tdb_store fails.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-31 00:10:54 +01:00
emellor@leeni.uk.xensource.com 1bac3b49cd Import the current version of talloc from the Samba 3 source base. This gives
us greater confidence that our talloc implementation is "known good".  Remove
the OOM handling from consider_message: talloc_set_fail_handler is no longer
supported.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-23 14:32:15 +01:00
vhanquez@kneesa.uk.xensource.com 3645dec056 fix buffer overflow in print XS_DEBUG command
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-03-15 12:24:34 +00:00
vhanquez@kneesa.uk.xensource.com 9d34613c4e move XS_DEBUG code into a proper function
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-03-15 12:08:10 +00:00
kaf24@firebug.cl.cam.ac.uk 945758df89 More build config changes:
- Build -O2 rather than -O3
 - Build with -Wstrict-prototypes
 - Move target-specific generic compiler switches to Config.mk

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-10 17:32:04 +01:00
kaf24@firebug.cl.cam.ac.uk d27fbb0061 Move 'debug' build option into the outermost Config.mk file.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-09 22:31:45 +01:00
emellor@leeni.uk.xensource.com 8ff99da748 Merged. 2006-03-04 19:16:36 +01:00
emellor@leeni.uk.xensource.com d34501c219 Log the tdb_error when a read fails with EIO. This is happening after a long
time under load -- hopefully this message will suggest why.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-04 19:12:37 +01:00
kaf24@firebug.cl.cam.ac.uk 262bd587ce /proc/xen/xsd_kva exports mmap interface that xenstored now uses to map the
domain0 xenbus page.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-03 19:07:55 +01:00
kaf24@firebug.cl.cam.ac.uk 74bb865dac Avoid floating point in hash table implementation.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-03 19:06:50 +01:00
emellor@leeni.uk.xensource.com c84e1f2ac5 Added further integrity checking, this time checking for duplicate directory
entries and for orphaned nodes in the database.

Added two flags, -R and -L, to disable the recovery code and the remove of
/local at start-up.  This makes it much easier to analyse corrupted tdb files.

Added some missing talloc_free calls in the previous integrity checking code.

Removed the transaction handle from the trace_io message -- unfortunately,
the transaction is always null at this point, as it's not yet been looked up.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-03 15:37:28 +01:00
emellor@leeni.uk.xensource.com 2700e32492 Cope if xenstore is down.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-02 21:45:13 +01:00
emellor@leeni.uk.xensource.com 186f0e02a1 Added hashtable implementation, to support the reachability check against the
store.  This code is by Christopher Clark.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-02 21:44:49 +01:00
emellor@leeni.uk.xensource.com 343da423ce Fix violation of C90 mixed-code-and-declarations restriction.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-02 03:21:17 +01:00
emellor@leeni.uk.xensource.com 03d3577c36 Fix printf.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-02 02:35:23 +01:00
emellor@leeni.uk.xensource.com 06d17943f0 Added a basic integrity checker, and some basic ability to recover from store
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>
2006-03-02 02:09:23 +01:00
emellor@leeni.uk.xensource.com 3ef81423e2 Remove unused #include <sys/ioctl.h>.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-01 17:52:37 +01:00
vhanquez@kneesa.uk.xensource.com aadfc97676 initialize few structure fully to zero with talloc_zero
instead of explicitely initializing some fields to NULL.

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-02-23 17:14:55 +00:00