Commit Graph
23 Commits
Author SHA1 Message Date
Juergen Gross 90c9f9f4dd tools: drop all deprecated usages of xs_*_open() and friends in tools
Switch all usages of xs_daemon_open*() and xs_domain_open() to use
xs_open() instead. While at it switch xs_daemon_close() users to
xs_close().

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wl@xen.org>
2020-10-08 12:47:59 +00:00
Ian Campbell 3248691679 tools: Refactor foreign memory mapping into libxenforeignmemory
libxenforeignmemory will provide a stable API and ABI for mapping
foreign domain memory (subject to appropriate privileges).

The new library exposes an interface equivalent to
xc_map_foreign_memory_bulk, which all the other
xc_map_foreign_memory_* functions (which remain in libxc) are
implemented in terms of.

Upon request (via #define XC_WANT_COMPAT_MAP_FOREIGN_API) libxenctrl
will provide a compat API for the old names. This is used by qemu-xen
and qemu-trad as well as various in tree things (which required
de-dupping various #includes in some too to get the #define before the
first).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
[ ijc -- updated MINIOS_UPSTREAM_REVISION and QEMU_TRADITIONAL_REVISION ]
2016-01-22 12:24:03 +00:00
Ross Lagerwall 26d4eebee8 xenconsoled: Remove unexpected daemonize behavior
Previously, xenconsoled's daemonize function would do nothing if its
parent process is init (as it is under systemd but not sysv init).
This is confusing. Instead, always daemonize when asked to, but use the
"interactive" switch when running from the systemd service.

Because a pidfile is only written when daemonizing, drop the pidfile
parameters from the service file (systemd keeps track of the pids
anyway).

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2015-11-04 15:11:00 +00:00
Ian Campbell 443701ef0c Replace FSF street address with canonical URL
As recommended in http://www.gnu.org/licenses/gpl-howto.en.html.

This is the result of:
$ git grep -El Mass\|Temple\|Franklin | xargs ./fsf.pl

Where fsf.pl is:
    #!/usr/bin/perl -w -pi.bak -0777
    my $repl = 'If not, see <http://www.gnu.org/licenses/>.';
    my $br = qr/(?:\s*\n\s*(?:[\*\#]|\/\/|\.\\" )?\s*|\s+)/;

    my $inwt = qr/[Ii]f${br}not,${br}write${br}(?:to${br})?the${br}Free${br}Software${br}Foundation,(?:${br}Inc\.,)?/;

    my $mass = qr/675${br}Mass${br}Ave,?${br}Cambridge,?${br}MA${br}02139,?${br}USA,?\.?/;
    my $franklin = qr/51${br}Franklin${br}St(?:reet)?(?:,${br}| - )Fifth${br}Floor,?${br}Boston,?${br}MA,?${br}02110-1301,?${br}USA,?\.?/;
    my $temple = qr/59${br}Temple${br}Place(?:,${br}| - )Suite${br}330,?${br}Boston,?${br}MA,?${br}021110?-1307,?${br}USA,?\.?/;

    s|$inwt$br$mass|$repl|m;
    s|$inwt$br$franklin|$repl|m;
    s|$inwt$br$temple|$repl|m;

The only remaining mentions of these addresses are in COPYING files which I
haven't touched.

Some of the changed files are imports from elsewhere, however
filtering them out is tricky, I think it is tolerable to have these
files be modified here and then perhaps reverted on the next sync,
since it's only 1-2 lines and obvious what is going on.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2015-07-29 11:14:07 +01:00
Andrew Cooper 9ab1792e1c tools/xenconsoled: Fix file handle leaks
Coverity ID: 715218 1055876 1055877

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2013-11-25 12:19:31 +00:00
Keir Fraser 5cc436c1d2 libxc: eliminate static variables, use xentoollog; API change
This patch eliminate the global variables in libxenctrl (used for
logging and error reporting).

Instead the information which was in the global variables is now in a
new xc_interface* opaque structure, which xc_interface open returns
instead of the raw file descriptor; furthermore, logging is done via
xentoollog.

There are three new parameters to xc_interface_open to control the
logging, but existing callers can just pass "0" for all three to get
the old behaviour.

All libxc callers have been adjusted accordingly.

Also update QEMU_TAG for corresponding qemu change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-05-28 09:30:19 +01:00
Keir Fraser b2ac1c4e50 xenconsoled: portability fixes:
- 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>
2007-10-08 10:55:50 +01:00
Keir Fraser c11a94127d Fix tools/console to build on NetBSD.
- 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>
2007-09-20 16:02:22 +01:00
kfraser@localhost.localdomain 96763f7c9a Add persistent guest & hv logging in xenconsoled.
* 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>
2007-06-04 14:49:12 +01:00
kfraser@localhost.localdomain 2d0b60a90f [SOLARIS] A couple of simple compile fixes for tools/ on Solaris.
Signed-off-by: John Levon <john.levon@sun.com>
2006-10-17 18:15:59 +01:00
kaf24@firebug.cl.cam.ac.uk 76f880fe7d [TOOLS] Introduce xc_evtchn_*() interface for interacting with /dev/xen/evtchn.
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>
2006-06-15 13:11:31 +01:00
Anthony Liguori d4895766cb Make sure to fork again after setsid() so that child cannot regain CTTY.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2005-12-12 15:11:13 +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 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
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 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 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
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