]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: Add helpers for safe domain console operations
authorPeter Krempa <pkrempa@redhat.com>
Fri, 25 Nov 2011 15:25:14 +0000 (16:25 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 27 Feb 2012 14:05:17 +0000 (15:05 +0100)
commit3f4238d7719ac6862490416ec9568074feded9de
treebe6e9b74f8a5c0844bfb9bcc63b296aebfa42f19
parent0c4bfdda42f176633a9db7c52703802e3f0123fe
util: Add helpers for safe domain console operations

This patch adds a set of functions used in creating console streams for
domains using PTYs and ensures mutually exclusive access to the PTYs.

If mutually exclusive access is not used, two clients may open the same
console, which results in corruption on both clients as both of them
race to read data from the PTY.

Two approaches are used to ensure this:
1) Internal data structure holding open PTYs.
        This is used internally and enables the user to forcibly
        terminate another console connection eg. when somebody leaves
        the console open on another host.

2) UUCP style lock files:
        This uses UUCP lock files according to the  FHS
        ( http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES )
        to check if other programs (like minicom) are not using the pty
        device of the console.

        This feature is disabled by default and may be enabled using
        configure parameter
        --with-console-lock-files=/path/to/lock/file/directory
        or --with-console-lock-files=auto (which tries to infer the
        location from OS used (currently only linux).

        On usual linux systems, normal users may not write to the
        /var/lock directory containing the locks. This poses problems
        while in session mode. If the current user has no access to the
        lockfile directory, check for presence of the file is still
        done, but no lock file is created. This does NOT result in an
        error.
configure.ac
po/POTFILES.in
src/Makefile.am
src/conf/virconsole.c [new file with mode: 0644]
src/conf/virconsole.h [new file with mode: 0644]
src/libvirt_private.syms