Commit Graph
37 Commits
Author SHA1 Message Date
emellor@leeni.uk.xensource.com 3805ba3b8a Correct buffer->size at the same time as buffer->capacity when shrinking down a
buffer that has grown beyond max_capacity.  This fixes a Xenconsoled segfault
that was caused by stomping around above the buffer's allocated region.  It
became possible to set the max_capacity with changeset 7431, and ever
since then we have been exposed to this bug.  It would most easily be triggered
by running a domain without a client attached to the console, so that the
max_capacity was reached more easily.

Closes bug #380.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-17 12:59:12 +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
kaf24@firebug.cl.cam.ac.uk ea894244ed Make the -V option of xenconsoled actually do something.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2005-11-02 11:25:21 +01:00
kaf24@firebug.cl.cam.ac.uk 68917d1380 Fix memory leak in domain cleanup spotted by doremifa in #xen.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2005-11-02 11:24:49 +01:00
emellor@leeni.uk.xensource.com 5c8eb3b727 Check whether dom is NULL when we handle a watch. This might occur if the
domain has recently been removed from our list, but with a watch still in
flight.  This should fix the intermittent crash in xenconsoled that is plaguing
us at the moment.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-26 13:41:00 +01:00
emellor@leeni.uk.xensource.com 493b98bf23 Do not create the console tty until domain_create_ring has succeeded. This
means that any reads attempted on that tty will not cause handle_tty_read to
segfault looking for an interface that does not exist.

Move the writing of the tty node so that it happens after console/limit has
been read, as it is cleaner if the writing is the last thing that happens.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-24 14:11:07 +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
kaf24@firebug.cl.cam.ac.uk dfc0b259c1 Add memory barriers to console ring accesses. Similar to what
Rusty uses for xenbus messaging.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-12 21:10:14 +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 4cd488119e Publish the virtual console interface in public/io/console.h.
Make the ring buffers a powe-of-two in size.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-11 14:14:54 +01:00
kaf24@firebug.cl.cam.ac.uk 25517fd2f2 Extend xenbus/xenstore client interface to include a transaction
handle on appropriate operations. Next step is to plug this
through to the store daemon and get rid of the nasty serialisation
mutex for transactions.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-09 21:29:10 +01:00
kaf24@firebug.cl.cam.ac.uk 4657d174ab Refactor xenbus to break up the xenbus_lock and permit watches
to fire concurrently with request/reply pairs. Remove
watch_ack message: no longer needed.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-09 18:52:54 +01:00
kaf24@firebug.cl.cam.ac.uk 76bd51c23d Change xs_read_watch interface to return a sized array (in userspace and in
kernel).

Add index macros (XS_WATCH_*) for accessing the array to allow for future
expansion.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2005-10-07 15:51:53 +01:00
kaf24@firebug.cl.cam.ac.uk 07a233ac7c User tools send evtchn notifications via /dev/xen/evtchn
rather than using hypercall directly.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-06 17:02:38 +01:00
kaf24@firebug.cl.cam.ac.uk c804adf4b6 Change how event channels are allocated and used by the control
tools. /dev/xen/evtchn is now used by daemons to connect to
remote domains: the advantage is that the local ports are garbage
collected automatically if the daemon dies. xen no longer
constructs end-to-end event-channel port pairs -- it allocates an
unbound port in new domU and writes that port to xenstore. It is
then picked up by teh appropriate daemon which does interdomain bind
via /dev/xen/evtchn.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-06 16:07:52 +01:00
kaf24@firebug.cl.cam.ac.uk 4a4ad39633 Send event-channel notification from console daemon
to guest console driver when the output ring is
emptied. This can be used to kick transmission of
more characters without needing to poll.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-05 16:32:07 +01:00
kaf24@firebug.cl.cam.ac.uk 45dc6ad80a xenstore fires @releaseDomain both when a domain shuts
down and when it eventually dies. xenconsoled now only
relinquishes its handle on a domain when it dies. This
allows us to 'xm console' connect to a crashed domain,
which is very useful!

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-09-26 18:49:21 +01:00
cl349@firebug.cl.cam.ac.uk 7fd9bccce2 Remove iflag argument to xs_write
xs_write with O_CREAT|O_EXCL causes problems over daemon restarts, since
it's not idempotent.
It turns out noone really needs the flags word at all, so get rid of it.
It's now as if everyone specified "O_CREAT".
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-09-19 14:34:30 +00:00
kaf24@firebug.cl.cam.ac.uk 3886819443 Remove unsued domain_controller.h file.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-09-14 10:58:00 +00:00
cl349@firebug.cl.cam.ac.uk 1a93386154 Fixed consoled race condition.
Signed-off by: Andy Peace <andrew.peace@xensource.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-09-13 10:13:52 +00:00
cl349@firebug.cl.cam.ac.uk 84592bf97c Check the return value of chdir(2) and write(2).
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-09-12 20:24:58 +00:00
vh249@arcadians.cl.cam.ac.uk 98806d61af add a simple usage string to xenconsoled
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2005-09-10 14:44:31 +00:00
cl349@firebug.cl.cam.ac.uk 4fa3210b97 Move console tty/limit information into console directory in domain dir.
Also only store port number of console event channel.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-09-07 21:24:34 +00:00
cl349@firebug.cl.cam.ac.uk b9e0af9b95 Don't leak memory when realloc fails.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-09-07 19:13:38 +00:00
cl349@firebug.cl.cam.ac.uk def1544a03 Use @releaseDomain watch-events.
This replaces listening to the domain exception virq through xcs.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-09-06 18:29:27 +00:00
cl349@firebug.cl.cam.ac.uk cbc1cab8bf Exit if xen_setup fails.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-09-06 18:18:56 +00:00
cl349@firebug.cl.cam.ac.uk b042c7d63f Update consoled to use xs_get_domain_path and cleanup domain tracking code.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-09-06 13:43:28 +00:00
cl349@firebug.cl.cam.ac.uk 84ff1f2155 Add @introduceDomain event-watch and replace consoled watch on /console.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-09-05 19:43:04 +00:00
shand@ubuntu.eng.hq.xensource.com b6e27d0a1e Fix save/restore when using grant tables in network, robust-ify netback
against bogus front-end drivers, plus various small cleanups. Note that 
there is now only /one/ config option controlling the use of grant tables
with networking (not separate ones for rx and tx). 

An outstanding issue is that console reconnect after a restore causes badness.

Signed-off-by: Steven Hand <steven@xensource.com>
2005-09-01 20:19:34 -08:00
cl349@firebug.cl.cam.ac.uk 632192e7a9 Use MIN instead of MAX to avoid reading more than fits into the buffer.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-08-31 08:43:31 +00:00
cl349@firebug.cl.cam.ac.uk af2f00c972 Use watch to detect new domains and avoid polling for dead domains.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-08-30 20:02:59 +00:00
cl349@firebug.cl.cam.ac.uk 14329d584a New console transport and update xenconsoled.
Add a new console interface using a seperate shared page and event channel
instead of passing the console input/output over control messages.
Update xenconsoled to use the new console interface.
Make xenconsoled garbage collect dying domains by subscribing to
the domain exception virq.
Signed-off-by: Robert Read <robert@xensource.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-08-30 16:14:53 +00:00
cl349@firebug.cl.cam.ac.uk 60eb663513 Rename libxc => libxenctrl and xc.h => xen/xenctrl.h
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>


--HG--
rename : tools/libxc/xc.h => tools/libxc/xenctrl.h
2005-08-24 23:07:29 +00:00
kaf24@firebug.cl.cam.ac.uk 3eeeaba7c9 Disable xenconsoled throttling for now. 2005-08-16 07:07:11 +00:00
kaf24@firebug.cl.cam.ac.uk 12ef0a9548 Under the right circumstances, xenconsoled will corrupt its internal
list of domains causing a SEGV.  This is usually characterized by a 
rapid number of creations/destructions.  The attached patch fixes this.

1) Fix uninitialized next pointer.  This could sometimes cause xenconsoled to
   SEGV on an invalid domain pointer
2) Fix race condition in iterating domain list where removing a domain in a
   callback could lead to the iterators becoming invalid.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2005-08-16 07:06:10 +00:00
cl349@firebug.cl.cam.ac.uk c2bf763b7f Make xen daemon startup more robust.
1) make xenconsoled exit gracefully if xcs dies
2) daemonize xenstored before binding to xenstored socket
3) wait to close stdio in xenstored until we're ready to accept
connections (so that PID=`xenstored --output-pid` doesn't return until
it's ready to accept connections)
4) updates tools/misc/xend for these changes
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustycorp.com.au>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-08-10 09:46:51 +00:00
kaf24@firebug.cl.cam.ac.uk ea9fb36c36 Really include renamed console files. :-)
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-08-07 09:13:39 +00:00