aboutsummaryrefslogtreecommitdiffstats
path: root/tools/console/daemon
Commit message (Collapse)AuthorAgeFilesLines
...
* [TOOLS] Introduce xc_evtchn_*() interface for interacting with /dev/xen/evtchn.kaf24@firebug.cl.cam.ac.uk2006-06-153-65/+28
| | | | | | | | 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>
* Fix xenconsoled when sending lots of console data to a domU.kaf24@firebug.cl.cam.ac.uk2006-03-301-12/+24
| | | | | | | | Fixes bug #477. Signed-off-by: Keir Fraser <keir@xensource.com>
* Replace NULL xenbus transaction by a specific XBT_NULL value.vhanquez@kneesa.uk.xensource.com2006-01-101-3/+3
| | | | | Signed-off-by: Vincent Hanquez <vincent@xensource.com>
* Make sure to fork again after setsid() so that child cannot regain CTTY.Anthony Liguori2005-12-121-0/+6
| | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Remove timeout on select -- there is no need for it, since we don't do anythingemellor@leeni.uk.xensource.com2005-12-071-2/+1
| | | | | | | in the main loop except service I/O. Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Fix printf of ssize_t that broke 64-bit build.emellor@leeni.uk.xensource.com2005-12-071-1/+1
| | | | | Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Add a "consumed" parameter to the buffer declaration, and use this to advanceemellor@leeni.uk.xensource.com2005-12-061-11/+24
| | | | | | | | through the buffer when the data are read by console clients. This avoids a costly memmove with every read from the console. Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Make the master fd belonging to the pty pair non-blocking. Writes were blockingemellor@leeni.uk.xensource.com2005-12-061-0/+3
| | | | | | | | | | | if the console client disconnected before all the data had been written to the pty, even though the select call had indicated that the fd was previously writable. Reads have been observed exhibiting similar behaviour too. Closes bug #380. Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Define explicit evtchn_port_t type (32 bits) and plumb upkaf24@firebug.cl.cam.ac.uk2005-12-011-2/+2
| | | | | | | | to user space thru /dev/xen/evtchn. Signed-off-by: Keir Fraser <keir@xensource.com>
* Don't refuse to clean up after a domain death when the buffer is not empty. Ifemellor@leeni.uk.xensource.com2005-11-301-3/+0
| | | | | | | | | | the domain has gone away, then no-one can attach to the pty because Xend will have cleaned up the entries in the store, so the pty will never become ready to write. The buffer will never get emptied, so cleanup will never occur. This leaks ptys, file descriptors, and memory. Simply throw those data away instead. Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Correct buffer->size at the same time as buffer->capacity when shrinking down aemellor@leeni.uk.xensource.com2005-11-171-1/+1
| | | | | | | | | | | | | | 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>
* Remove unnecessary NULL checks before freeing memory blocks.kaf24@firebug.cl.cam.ac.uk2005-11-111-11/+6
| | | | | | | | | The following functions check for NULL internally: free, kfree, xfree, free_xenheap_page[s] Signed-off-by: Keir Fraser <keir@xensource.com>
* Make the -V option of xenconsoled actually do something.kaf24@firebug.cl.cam.ac.uk2005-11-021-4/+8
| | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix memory leak in domain cleanup spotted by doremifa in #xen.kaf24@firebug.cl.cam.ac.uk2005-11-021-4/+13
| | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Check whether dom is NULL when we handle a watch. This might occur if theemellor@leeni.uk.xensource.com2005-10-261-1/+3
| | | | | | | | | 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>
* Do not create the console tty until domain_create_ring has succeeded. Thisemellor@leeni.uk.xensource.com2005-10-241-9/+21
| | | | | | | | | | | 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>
* 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>
* Add memory barriers to console ring accesses. Similar to whatkaf24@firebug.cl.cam.ac.uk2005-10-121-36/+40
| | | | | | | | Rusty uses for xenbus messaging. Signed-off-by: Keir Fraser <keir@xensource.com>
* Fix Xen public interfaces and the tools to consistentlykaf24@firebug.cl.cam.ac.uk2005-10-121-1/+1
| | | | | | | | use stdint-format bitsize types (uint32_t and friends). Signed-off-by: Keir Fraser <keir@xensource.com>
* Publish the virtual console interface in public/io/console.h.kaf24@firebug.cl.cam.ac.uk2005-10-111-38/+46
| | | | | | | | Make the ring buffers a powe-of-two in size. Signed-off-by: Keir Fraser <keir@xensource.com>
* Extend xenbus/xenstore client interface to include a transactionkaf24@firebug.cl.cam.ac.uk2005-10-091-3/+3
| | | | | | | | | | 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>
* Refactor xenbus to break up the xenbus_lock and permit watcheskaf24@firebug.cl.cam.ac.uk2005-10-091-1/+0
| | | | | | | | | to fire concurrently with request/reply pairs. Remove watch_ack message: no longer needed. Signed-off-by: Keir Fraser <keir@xensource.com>
* Change xs_read_watch interface to return a sized array (in userspace and inkaf24@firebug.cl.cam.ac.uk2005-10-071-3/+4
| | | | | | | | | | | kernel). Add index macros (XS_WATCH_*) for accessing the array to allow for future expansion. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* User tools send evtchn notifications via /dev/xen/evtchnkaf24@firebug.cl.cam.ac.uk2005-10-061-2/+9
| | | | | | | | rather than using hypercall directly. Signed-off-by: Keir Fraser <keir@xensource.com>
* Change how event channels are allocated and used by the controlkaf24@firebug.cl.cam.ac.uk2005-10-061-27/+28
| | | | | | | | | | | | | | 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>
* Send event-channel notification from console daemonkaf24@firebug.cl.cam.ac.uk2005-10-051-0/+6
| | | | | | | | | | 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>
* xenstore fires @releaseDomain both when a domain shutskaf24@firebug.cl.cam.ac.uk2005-09-261-1/+1
| | | | | | | | | | | 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>
* Remove iflag argument to xs_writecl349@firebug.cl.cam.ac.uk2005-09-191-1/+1
| | | | | | | | | | 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>
* Remove unsued domain_controller.h file.kaf24@firebug.cl.cam.ac.uk2005-09-142-4/+0
| | | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Fixed consoled race condition.cl349@firebug.cl.cam.ac.uk2005-09-131-1/+3
| | | | | | Signed-off by: Andy Peace <andrew.peace@xensource.com> Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Check the return value of chdir(2) and write(2).cl349@firebug.cl.cam.ac.uk2005-09-121-2/+4
| | | | | Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* add a simple usage string to xenconsoledvh249@arcadians.cl.cam.ac.uk2005-09-101-1/+7
| | | | | Signed-off-by: Vincent Hanquez <vincent@xensource.com>
* Move console tty/limit information into console directory in domain dir.cl349@firebug.cl.cam.ac.uk2005-09-071-16/+25
| | | | | | Also only store port number of console event channel. Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Don't leak memory when realloc fails.cl349@firebug.cl.cam.ac.uk2005-09-071-3/+5
| | | | | Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Use @releaseDomain watch-events.cl349@firebug.cl.cam.ac.uk2005-09-063-123/+11
| | | | | | This replaces listening to the domain exception virq through xcs. Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Exit if xen_setup fails.cl349@firebug.cl.cam.ac.uk2005-09-061-3/+2
| | | | | Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Update consoled to use xs_get_domain_path and cleanup domain tracking code.cl349@firebug.cl.cam.ac.uk2005-09-063-85/+131
| | | | | Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Add @introduceDomain event-watch and replace consoled watch on /console.cl349@firebug.cl.cam.ac.uk2005-09-052-6/+5
| | | | | Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Fix save/restore when using grant tables in network, robust-ify netback shand@ubuntu.eng.hq.xensource.com2005-09-011-1/+1
| | | | | | | | | | | 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>
* Use MIN instead of MAX to avoid reading more than fits into the buffer.cl349@firebug.cl.cam.ac.uk2005-08-311-1/+1
| | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* Use watch to detect new domains and avoid polling for dead domains.cl349@firebug.cl.cam.ac.uk2005-08-304-47/+86
| | | | | Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* New console transport and update xenconsoled.cl349@firebug.cl.cam.ac.uk2005-08-302-90/+212
| | | | | | | | | | | 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>
* Rename libxc => libxenctrl and xc.h => xen/xenctrl.hcl349@firebug.cl.cam.ac.uk2005-08-243-3/+3
| | | | | | | | | 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
* Disable xenconsoled throttling for now.kaf24@firebug.cl.cam.ac.uk2005-08-161-0/+2
|
* Under the right circumstances, xenconsoled will corrupt its internal kaf24@firebug.cl.cam.ac.uk2005-08-161-5/+20
| | | | | | | | | | | | | | 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>
* Make xen daemon startup more robust.cl349@firebug.cl.cam.ac.uk2005-08-102-0/+4
| | | | | | | | | | | | | 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>
* Really include renamed console files. :-)kaf24@firebug.cl.cam.ac.uk2005-08-075-0/+760
Signed-off-by: Keir Fraser <keir@xensource.com>