Commit Graph
151 Commits
Author SHA1 Message Date
emellor@leeni.uk.xensource.com ae52011af4 Cope with -1 eventchn_fd -- this occurs when using --no-domain-init (a
command line debugging option).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-02-10 03:23:36 +01:00
cl349@firebug.cl.cam.ac.uk aaf0872464 Use /dev/kmem to map dom0 xenstore page instead of abusing the foreign mapping interface.
Change /proc/xen/xsd_mfn to /proc/xen/xsd_kva containing the kernel
virtual address of the dom0 xenstore page.  Update xenstored to use
/proc/xen/xsd_kva.

Signed-off-by: Keir Fraser <keir@xensource.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2006-02-08 12:03:52 +00:00
vhanquez@kneesa.uk.xensource.com ba032ccb43 reindent few lines that were using softtab instead of hardtab.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-01-24 13:21:11 +00:00
vhanquez@kneesa.uk.xensource.com 9ebf278d68 add some checking of opening and read in dom0_init and return -1 if error.
instead of crashing, it now prints a more meaningful error message.

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-01-24 13:14:42 +00:00
vhanquez@kneesa.uk.xensource.com 78f406938d use talloc_zero instead of talloc + memset
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-01-24 12:03:06 +00:00
vhanquez@kneesa.uk.xensource.com 79157a6885 use format printf style to write to tracefd instead of using write syscall.
add a static buffer to trace() instead of always allocating from the heap.

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-01-24 11:50:38 +00:00
vhanquez@kneesa.uk.xensource.com caeab9b2e0 fixup memory leak and return value, if malloc or realloc fail.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-01-24 10:55:45 +00:00
vhanquez@kneesa.uk.xensource.com 69f3c56296 fixup reallocation to "twice the size + 1", instead of "3 times the size".
max *= 2 + 1 <==> max *= 3

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-01-24 10:52:52 +00:00
vhanquez@kneesa.uk.xensource.com 6ab3d2a421 dup and open error value is -1, not < 0
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-01-24 10:37:44 +00:00
kaf24@firebug.cl.cam.ac.uk 1d2c4dd171 Having /usr/bin/xsls conflicts with xsls as distributed in scalapack
(http://www.netlib.org/scalapack/).  It should probably be xenstore-ls
a) for namespacing and b) to match up with the other xenstore commands
better. 

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-01-19 09:16:01 +01:00
vhanquez@kneesa.uk.xensource.com 6bc154ed1e make xs_test in xenstore compile.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-01-11 12:02:54 +00:00
vhanquez@kneesa.uk.xensource.com d9014bb4aa update xs_transaction_t to be a plain u32 integer instead of a fake pointer.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-01-11 12:01:37 +00:00
vhanquez@kneesa.uk.xensource.com 53ed6896f3 Share the same name for xenbus transaction type between user and kernel
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-01-11 11:46:32 +00:00
vhanquez@kneesa.uk.xensource.com ec5303c071 Change xenbus_transaction fake pointer into an opaque type.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-01-10 17:16:30 +00:00
vhanquez@kneesa.uk.xensource.com e92fb45b06 Replace NULL xenbus transaction by a specific XBT_NULL value.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-01-10 15:05:05 +00:00
emellor@leeni.uk.xensource.com d9efa5305f Fix comment describing return value -- xs_rm returns false if the path does not
exist, not true.
 
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-01-03 16:29:42 +00:00
Anthony Liguori d4895766cb Make sure to fork again after setsid() so that child cannot regain CTTY.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2005-12-12 15:11:13 +00:00
emellor@leeni.uk.xensource.com afa150ca7c Fix the startup behaviour when the tdb file exists. We were attempting to
remove and recreate the /local directory, but the manual_node call only works
if the tdb is empty -- we must use create_node, otherwise the store is
corrupted.

It's not clear to me that the other manual_node calls are safe, but I have only
made this smaller change for the sake of stability.  These other calls should
be reviewed.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-07 15:44:38 +00:00
emellor@leeni.uk.xensource.com d3079e2611 Initialise the connection ID when a domain is introduced. This (re)enables
the permission checking in xenstored.

Default the store permissions to read/write nobody (apart from the privileged
domain).  Create a /local node with these permissions, ready for inheriting by
children.  In Xend, create a /vm node with these permissions too, for the same
reason, and set the permissions on /local/domain/<domid> and each device
backend path to allow the guest domain to access these paths appropriately.

Added xstransact.{set_permissions,SetPermissions,mkdir,Mkdir,complete} as
support facilities.

This closes bug #290.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-02 01:34:39 +00:00
kaf24@firebug.cl.cam.ac.uk 96428d33d9 Define explicit evtchn_port_t type (32 bits) and plumb up
to user space thru /dev/xen/evtchn.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-12-01 15:22:22 +01:00
emellor@leeni.uk.xensource.com b090f499e1 Remove /local when xenstored starts. This stops stale data affecting the
system immediately after reboot.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-01 03:32:39 +00:00
emellor@leeni.uk.xensource.com f6d80a7f57 Reverse accidental commits for changesets 8001 and 7996-7999.
The Mercurial Queues extensions suddenly looks a lot less useful than it first
seemed.
 
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-23 19:37:33 +00:00
emellor@leeni.uk.xensource.com 8856d17150 imported patch my-config 2005-11-23 19:19:23 +00:00
kaf24@firebug.cl.cam.ac.uk 869e86d8e6 Add -Wdeclaration-after-statement to Xen and tools build.
Fix the compile errors that result from this.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-22 18:44:08 +01:00
emellor@leeni.uk.xensource.com d6840089fb Initialise the request ID in xs_talkv, to silence valgrind. We're not actually
using this value at the moment -- it's only there for use by future clients.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-17 20:25:47 +01:00
emellor@leeni.uk.xensource.com 8fc503a014 Disable use of mmap. This allows Xenstored to run with an NFS-mounted
/var/lib/xenstored.  Closes bug #400.  This fix no doubt has a performance hit,
so I have opened bug #401 to discuss a better fix.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-12 17:51:14 +01:00
kaf24@firebug.cl.cam.ac.uk f8e8438eef Remove unnecessary NULL checks before freeing memory blocks.
The following functions check for NULL internally:
 free, kfree, xfree, free_xenheap_page[s]

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-11 12:55:47 +01:00
emellor@leeni.uk.xensource.com a22a20e2bb Fix the log reopening by moving the code with all the races out of the signal
handler and into the main loop.  The "self-pipe trick" is used to awaken the
select() call on SIGHUP.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-10 16:20:27 +01:00
kaf24@firebug.cl.cam.ac.uk 5e034a1be8 Fix the clean target of the tools/xenstore Makefile to
remove all files created. Currently leaves some of its
files behind.

Signed-off-by: Tobias Hunger <tobias@aquzul.com>
2005-11-08 12:06:18 +01:00
emellor@leeni.uk.xensource.com 0fad7c8152 Make xenstored reopen its trace file on SIGHUP. This allows one to rotate the
logs beneath the daemon.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-07 12:28:53 +01:00
kaf24@firebug.cl.cam.ac.uk 0a2a26aa78 Make it clear that the result of xs_get_domain_path() must be free()'d. 2005-11-02 11:25:08 +01:00
kaf24@firebug.cl.cam.ac.uk 41ae27972e Remove all binaries on make clean. 2005-10-27 17:20:33 +01:00
emellor@leeni.uk.xensource.com e4ba1fec3e Fix format spec for tracing.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-25 16:00:49 +01:00
emellor@leeni.uk.xensource.com 8b6e8053b8 Added a timestamp to the logging output by trace_io.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-24 14:12:42 +01:00
emellor@leeni.uk.xensource.com fea7782321 Change the semantics of GetDomainPath so that it always succeeds, regardless of
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>
2005-10-23 22:45:15 +01:00
emellor@leeni.uk.xensource.com a04a1a1dc7 Break proc paths out into separate include file, rather than inlining them.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-21 13:30:31 +01:00
emellor@leeni.uk.xensource.com 2b99d6e3a9 Take advantage of the new UUID (handle) stored for us in Xen to improve the
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>
2005-10-19 11:47:51 +01:00
cl349@firebug.cl.cam.ac.uk 006b46b2d0 Fix transaction EAGAIN handling in xenstore client programs.
Redirect all output to a buffer and only print the buffer once the
transaction succeeds, discarding output from previous attempts.
In particular, fixes failures when the (block) backend driver would
not configure because reads from the hotplug script did get double
output when a transaction had to be redone.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-10-18 02:08:26 +01:00
emellor@leeni.uk.xensource.com 706fcdf4de Have xenstored initialise its connections, meaning that xend can be out of
that loop completely -- the xc_init_store, initDomainStore calls can all go.

Have xenstored understand where the local domain information goes.  Xend no
longer has to generate a path and pass it to xenstored through
xs_introduce_domain -- we just allow xenstored to generate the path, and then
call GetDomainPath later.  There is still some work required to tidy this up.

Change the uuid module to generate uuids as lists of bytes, not in the
stringified form.  Added a unit test for that module.

Change the semantics of Xend restart, relying on these changes to the
xenstored semantics and earlier changes to add an opaque handle to the
hypervisor's domain-specific data block.  The semantics are now clearer, as
Xend can validate whether the details in the store match the current live
domain.

Added a usage statement to xenstored.

Some of this code is by Steven Hand.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-17 16:22:05 +01:00
emellor@leeni.uk.xensource.com 9f7fae040f Added --tidy flag to xenstore-rm that recursively removes any empty directories
left by the primary removal.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-15 12:52:38 +01:00
kaf24@firebug.cl.cam.ac.uk b5d8fa2d87 Fix client dependency on libxenstore in Makefile.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-13 11:12:11 +01:00
kaf24@firebug.cl.cam.ac.uk 3b83e00b15 Change xenstore-domain messaging protocol to match what we use
for other inter-domain comms (power-of-two-sized rings, and
free-running indexes). The interface is defined in the spirit of
the console protocol, so maybe some chance of merging them
together later?

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-12 18:25:40 +01:00
kaf24@firebug.cl.cam.ac.uk a54918631e Fix xsls build dependency.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-12 18:18:43 +01:00
emellor@ewan 1d47535f5f Fix the handling of EAGAIN from the transaction_end; we were failing to do any
work if the transaction caused a retry, because optind had been obliterated.
Achieve this by splitting the main body of the loop off to a separate function,
meaning that we get rid of the goto out at the same time.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-12 12:03:03 +01:00
kaf24@firebug.cl.cam.ac.uk d8263e8dba Fix Xen public interfaces and the tools to consistently
use stdint-format bitsize types (uint32_t and friends).

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-12 11:07:37 +01:00
kaf24@firebug.cl.cam.ac.uk e8d5405d57 Fix compilation problems with xenstore.
Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
2005-10-12 09:34:27 +01:00
jrb44@freefall.cl.cam.ac.uk 26f6adc1c8 Added xsls to xenstore Makefile install dependencies to fix "make dist".
Signed-off-by: James Bulpin <james@xensource.com>
2005-10-11 14:26:23 +01:00
kaf24@firebug.cl.cam.ac.uk 490bab7b96 Xenstore client library spawns a reader thread the first
time a watch is registered. Before this it is fine for
caller threads to read the comms channel directly as no
async messages will be received.

This avoids various user tools needlessly creating three
threads where one will do the job.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-11 13:02:59 +01:00
kaf24@firebug.cl.cam.ac.uk 11dde699b0 Echo request and transaction identifiers in xenstored
replies (and set to zero for async watch events).

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-11 12:39:03 +01:00
emellor@ewan e248dc43ae Added xsls utility, which recursively lists the contents of the store.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-11 10:29:29 +01:00