aboutsummaryrefslogtreecommitdiffstats
path: root/tools/console
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix master/slave handling in xenconsoled and qemuKeir Fraser2007-12-191-64/+76
| | | | | | | | | | | | | | | Fix a number of problems with the pty handling: - make openpty() implementation work on Solaris - set raw on the slave fd, not the master, as the master doesn't have a line discipline pushed on Solaris - make sure we don't leak the slave fd returned from openpty() - don't use the 'name' argument of openpty() as it's a security risk - note behaviour of a zero read of the master on Solaris - remove pointless tcget/setattr Signed-off-by: John Levon <john.levon@sun.com> Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
* Fix use-after-free in xenconsoled.Keir Fraser2007-11-011-1/+9
| | | | | | | | | | | | | | shutdown_domain() MUST NOT call cleanup_domain(), just flagging them as dead is enough. cleanup_domains() for dead domains is called by the main loop in handle_io() in a safe way already. shutdown_domain() calling cleanup_domain() too leads struct domain being accessed after freeing and to a double-free. Fixed by simply dropping the cleanup_domain() call and by making the functions called by the main loop in handle_io() ignore dead domains. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* xenconsoled: Rate-limit activity caused by each domU.Keir Fraser2007-10-291-6/+68
| | | | | Allow each domU to fire its event channel at most 30 times every 200ms. Signed-off by: Daniel P. Berrange <berrange@redhat.com>
* Allow incremental access to hypervisor console log.Keir Fraser2007-10-291-17/+46
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* pv-qemu 10/10: Make xenconsoled ignore doms with qemu-dmKeir Fraser2007-10-251-0/+9
| | | | | | | | | | | | | | | | | This patch writes a field /local/vm/DOMID/console/type taking the value 'ioemu' or 'xenconsoled'. If xenconsoled sees a type that is not its own, then it skips handling of that guest. The qemu-dm process doesn't need to read this field since it will only attach to the console if given the -serial pty arg which XenD already ensures matches this xenstore field. The overall behaviour is that if a paravirt guest has a qemu-dm process running then that handles the console, otherwise the xenconsoled handles it. The former is more functional, with the exception of not currently supporting persistent logging to a file at the same time as exposing a PTY. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* xenconsoled: portability fixes:Keir Fraser2007-10-083-49/+99
| | | | | | | | | | | | | | | - Use openpty(), which does the same as the sequence of open(), grantpt(), unlockpt(), ptsname(), tcgetattr() simplifies code - Check return code from tcsetattr() - sprintf() -> snprintf() - OpenBSD lacks POSIX grantpt() and unlockpt() requires use of openpty() - Solaris lacks POSIX openpty() via feedback from SUN (John Levon) implement openpty() for Solaris, tested and ok'd by SUN (John Levon) Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* Fix tools/console to build on NetBSD.Keir Fraser2007-09-202-3/+4
| | | | | | | | - include headers needed to build on NetBSD - Remove unused pty.h - Initialize spty terminal before actually using it Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* xenconsoled: improve robustness of logfile handlingKeir Fraser2007-06-271-14/+22
| | | | | | | | | | | | | | | Check the 'log_reload' on every iteration of the select() loop, not just when select() returns EINTR. This is because the log reload signal may have iterrupted a syscall other than select & thus without this change we might miss the reload signal. The second change makes us process the hypervisor logs on every iteration of the loop, not just upon timeouts. This is because if a guest VM were consistently sending some log message and < 1 second period, the select() would never hit the 1 second timeout and thus never process the HV logs. Thanks to Markus Armbruster for pointing out both these edge cases Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* tools: warn_unused_result build fixes.kfraser@localhost.localdomain2007-06-121-1/+4
| | | | | | | | | | | | Note that some of the existing error checking for asprintf was wrong for Linux. asprintf in glibc returns -1 on error, but leaves the pointer uninitialized. Only the BSDs zero out the pointer on error. Also, while fixing these warnings I saw several error paths that were incorrect. This patch minimally fixes the warn_unused_result; more complete error path cleanup will be a later patch. Signed-off-by: Charles Coffing <ccoffing@novell.com>
* tools: Fix some type issues GCC 4.1.0 warnings.kfraser@localhost.localdomain2007-06-071-1/+2
| | | | | | | | FC5's gcc 4.1.0 can't make some files in tools/ due to its stronger type checking. From: Dexuan Cui <dexuan.cui@intel.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* console daemon: Fix realloc() usage.kfraser@localhost.localdomain2007-06-051-0/+1
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Add persistent guest & hv logging in xenconsoled.kfraser@localhost.localdomain2007-06-043-6/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | * The --log command line argument takes one of 4 values - none - no logging (the default) - hv - log all hypervisor messages - guest - log all guest messages - both - log all guest & hypervisor messages * The --log-dir command line argument takes a path to specify where to store logfiles. If omitted it defaults to /var/log/xen/console * The hypervisor logfile is $LOGDIR/hypervisor.log * The guest logfile is $LOGDIR/guest-[NAME].log * If receiving a SIGHUP it will close & re-open all log files to enable logrotate to do its magic * Fixes the permissions of /var/run/xenconsoled.pid * Adds a --pid-file command line argument to override the default location of pid file (this is not really related to logging, but since I was in that code...) Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Console daemon - remove duplicate include.kfraser@localhost.localdomain2007-05-241-1/+0
| | | | Signed-off-by: Mats Petersson <mats.petersson@amd.com>
* [pv console] Move console information in xenstore to serial/0/.Christian Limpach2007-05-011-8/+62
| | | | | | | | Support information in console/ in a backwards compatible fashion. This puts the serial port information for pv domains at the same location where it is for hvm domains. Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
* tools: Clean up use of 'install' command.kfraser@localhost.localdomain2007-03-071-2/+2
| | | | | | | | | - convert raw "install" command to use $(INSTALL) - convert some $(INSTALL) to $(INSTALL_DATA) as appropriate - modify the specific $(INSTALL) definitions to use -p. Original patch by Ben Thomas <ben@virtualiron.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* Xenconsoled should ignore spurious watch event. Otherwise, it can rebind to ↵john.levon@sun.com2007-02-191-0/+8
| | | | | | the same evtchn of a dying domU during suspending and cause below error message: (XEN) event_channel.c:177:d0 EVTCHNOP failure: domain 0, error -22, line 177
* [PYGRUB] Plumb bootloader I/O through xenconsole.Tim Deegan2007-01-221-39/+76
| | | | | | | | | | | | - xend forwards console traffic between the running bootloader and a pty which it writes to the store so the xenconsole client can see it. - the xenconsole client handles the domain's console pty changing. - xm create no longer runs the bootloader. - pygrub gets '-i' option to explicitly request an interactive session. - xend unlocks the domain list during bootloading so that "xm console" can see the domain and attach to its console pty. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* Stop enforcing -g for some of the tools.kfraser@localhost.localdomain2006-10-311-1/+1
| | | | Signed-off-by: John Levon <john.levon@sun.com>
* [SOLARIS] A couple of simple compile fixes for tools/ on Solaris.kfraser@localhost.localdomain2006-10-172-2/+2
| | | | Signed-off-by: John Levon <john.levon@sun.com>
* [SOLARIS] On Solaris, GCC is configured to use Sun's LD. Fix the build to usekfraser@localhost.localdomain2006-10-171-2/+2
| | | | | | the correct flags, and link against libsocket where necessary. Signed-off-by: John Levon <john.levon@sun.com>
* Clean up duplication of 'install' macros in the Makefiles.kfraser@localhost.localdomain2006-10-171-4/+0
| | | | Signed-off-by: John Levon <john.levon@sun.com>
* [CONSOLED] Shouldn't call domain_create_ring() for a domU which is shutting ↵kaf24@firebug.cl.cam.ac.uk2006-09-131-4/+6
| | | | | | | | | | | | down. There is a race condition between domain_create_ring() and the removal of the domU entry from xenstore. If the removal of the domU entry from xenstore comes later than the first xs_gather() call in domain_create_ring(), it will go on and bind the evtchn port to the dying domU, which will cause below error message: (XEN) (file=event_channel.c, line=144) EVTCHNOP failure: domain 0, error -22, line 144 Signed-off-by: Max Zhen <max.zhen@sun.com>
* This patch improves error message of xm console command.Ewan Mellor2006-09-051-1/+2
| | | | | | | | | # xm console Domain-0 Can't specify Domain-0 Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
* The following patch fixes a bug where xenconsoled will can SEGVkaf24@localhost.localdomain2006-08-281-8/+6
| | | | | | | | because it uses FD_ISSET(-1,xxx). Since the code is written that any ring/tty handler can set d->tty_fd to -1 it has to be checked _every_time_. Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
* [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>
* build: Clean up use of .PHONYkaf24@firebug.cl.cam.ac.uk2006-04-102-0/+5
| | | | | | | | | | | | * 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>
* Remove some dead code from the consoled client.kaf24@firebug.cl.cam.ac.uk2006-04-031-9/+2
| | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.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>
* Increase timeout while waiting for console/tty node to appear in the store:emellor@leeni.uk.xensource.com2006-03-211-1/+1
| | | | | | | | | the intention appears to have been 500msec, but struct timeval when used with a select() is in usec, not msec. The timeout has been set to 250msec (500msec seems a little long, in any case). Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Move 'debug' build option into the outermost Config.mk file.kaf24@firebug.cl.cam.ac.uk2006-03-091-2/+3
| | | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Clean up the usage of CFLAGS. This is nice for packagers, who wouldkaf24@firebug.cl.cam.ac.uk2006-03-091-1/+1
| | | | | | | | like to control the base compilation flags from a central place. Signed-off-by: Charles Coffing <ccoffing@novell.com>
* Replace NULL xenbus transaction by a specific XBT_NULL value.vhanquez@kneesa.uk.xensource.com2006-01-102-5/+5
| | | | | 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>
* Reverse accidental commits for changesets 8001 and 7996-7999.emellor@leeni.uk.xensource.com2005-11-231-1/+1
| | | | | | | | The Mercurial Queues extensions suddenly looks a lot less useful than it first seemed. Signed-off-by: Ewan Mellor <ewan@xensource.com>
* imported patch my-configemellor@leeni.uk.xensource.com2005-11-231-1/+1
|
* 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>