aboutsummaryrefslogtreecommitdiffstats
path: root/tools/console
Commit message (Collapse)AuthorAgeFilesLines
* xenconsoled: replace gettimeofday with clock_gettimeKeir Fraser2008-07-302-7/+7
| | | | | | | | | | | | Currently if someone changes the date on the host, xenconsoled may behave incorrectly due to the use of gettimeofday for the rate control algorithm. For example I was able to hang the console connected to a guest just setting the date forward 20 years. To solve the problem we need to use a time source that doesn't change start point, that is clock_gettime with CLOCK_MONOTONIC. The only bad side effect is that it introduces a dependency to librt, but I think is well worth it. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* tools: Declare functions static where they should be, and provideKeir Fraser2008-07-151-1/+1
| | | | | | proper prototypes for others as required. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* tools: replace sprintf with snprintf where applicableKeir Fraser2008-06-121-1/+2
| | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* console: Provide option to stall the inter-domain console ring ratherKeir Fraser2008-04-222-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | than discard characters in the console daemon buffers. New option: -o, --overflow-data=discard|keep This option changes the behaviour when dealing with data that overflow the max capacity of the buffer. If overflow-data is set to discard (the default), the current behaviour is used: we discard some data in the middle of the buffer. If overflow-data is set to keep, we stop listening to the ring until we free some space in the buffer. This can cause the ring to fill up and the guest kernel internal buffer to fill up as well. When this happens the guest kernel stops reading characters from the console device so the application generating data hangs. When xenconsoled resumes reading from the ring, the guest kernel will be able to resume reading from the console device as well. At that point the guest application will be allowed to continue. The risk of making this behaviour the default is that existing kernel drivers may assume they can rely on timely ring updates by the console daemon and thus themselves block on the ring being emptied. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* xenconsoled: don't force newline with timestampsKeir Fraser2008-02-201-35/+52
| | | | | | | | | | | | | | Previously a newline was forced after every call to write_with_timestamp. This could result in some ugly logs when a single console line stretched over multiple calls. This change carries some extra state to determine if we ended the last call to write_with_timestamp on a newline, and prints the timestamp as appropriate. This also fixes a bug where logging hv messages was dependent on the guest timestamp flag. Signed-off-by: Cole Robinson <crobinso@redhat.com>
* xenconsoled: Use ISO8601 date stamp format.Keir Fraser2008-02-151-1/+1
| | | | Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
* libxenctrl headers should not pollute macro namespace withKeir Fraser2008-02-121-4/+4
| | | | | | | mb/rmb/wmb. Instead add a xen_ prefix. Modify Xen's public headers to expect the prefixed names instead of bare mb/rmb/wmb, but gate this expectation on a bump of __XEN_INTERFACE_VERSION__. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Add timestamp option to xenconsoledKeir Fraser2008-02-122-11/+99
| | | | | | | | | | | Similar to the --log option, --timestamp or -t takes: - none : No timestamping - hv : Timestamp hypervisor logs - guest: Timestamp guest logs - all : Timestamp guest and hypervisor logs From: Cole Robinson <crobinso@redhat.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Define CFLAGS and LDFLAGS for libxenstore.Keir Fraser2008-01-271-5/+6
| | | | Signed-off-by: Bastian Blank <waldi@debian.org>
* Define CFLAGS and LDFLAGS for libxenctrl.Keir Fraser2008-01-271-6/+6
| | | | Signed-off-by: Bastian Blank <waldi@debian.org>
* Add PRIVATE_BINDIR. Use it.Keir Fraser2008-01-261-4/+2
| | | | Signed-off-by: Bastian Blank <waldi@debian.org>
* Move generation of public header hierarchy into the tools.Keir Fraser2008-01-261-0/+1
| | | | | | | This patch merges the two versions of public header generation currently used in the build into one. Signed-off-by: Bastian Blank <waldi@debian.org>
* Add SBINDIR. Use it always.Keir Fraser2008-01-221-3/+2
| | | | Signed-off-by: Bastian Blank <waldi@debian.org>
* Apply PREFIX directly to LIBDIR.Keir Fraser2008-01-221-1/+1
| | | | Signed-off-by: Bastian Blank <waldi@debian.org>
* tools: LDFLAGS in link linesKeir Fraser2008-01-171-2/+2
| | | | | | | LDFLAGS is not honoured by a couple of link lines in tools/*, but should be. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xenconsoled: Make slave pty raw during initialization.Keir Fraser2008-01-161-4/+21
| | | | | | (This avoids echo). Signed-off-by: Tristan Gingold <tgingold@free.fr>
* 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>