| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
proper prototypes for others as required.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
|
|
|
|
| |
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Bastian Blank <waldi@debian.org>
|
|
|
|
| |
Signed-off-by: Bastian Blank <waldi@debian.org>
|
|
|
|
| |
Signed-off-by: Bastian Blank <waldi@debian.org>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Bastian Blank <waldi@debian.org>
|
|
|
|
| |
Signed-off-by: Bastian Blank <waldi@debian.org>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
(This avoids echo).
Signed-off-by: Tristan Gingold <tgingold@free.fr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Allow each domU to fire its event channel at most 30 times every 200ms.
Signed-off by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
| |
Signed-off-by: Keir Fraser <keir@xensource.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Keir Fraser <keir@xensource.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
| |
Signed-off-by: Mats Petersson <mats.petersson@amd.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
| |
Signed-off-by: John Levon <john.levon@sun.com>
|
|
|
|
| |
Signed-off-by: John Levon <john.levon@sun.com>
|
|
|
|
|
|
| |
the correct flags, and link against libsocket where necessary.
Signed-off-by: John Levon <john.levon@sun.com>
|
|
|
|
| |
Signed-off-by: John Levon <john.levon@sun.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
# xm console Domain-0
Can't specify Domain-0
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
| |
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Fixes bug #477.
Signed-off-by: Keir Fraser <keir@xensource.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Signed-off-by: Keir Fraser <keir@xensource.com>
|
|
|
|
|
|
|
|
| |
like to control the base compilation flags from a central place.
Signed-off-by: Charles Coffing <ccoffing@novell.com>
|
|
|
|
|
| |
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
|
|
|
|
|
|
| |
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
|
|
|
|
|
| |
in the main loop except service I/O.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
|