[libvirt] [PATCH v2 0/6] Console coruption with two or more clients series

Peter Krempa pkrempa at redhat.com
Wed Dec 7 18:08:00 UTC 2011

This series fixes anoying console corruption if two clients try to connect
at same time to the console. The current state of this is, that two/more
of threads compete for the data from the PTY. This causes that each of the
consoles get scrambled and unusable.

These patches add mutual exclusion for opening consoles with two different
approaches and a option to terminate existing console streams.

A sample implementation is done using qemu driver, but i'll add more of them
if this will be OK. (They're basicaly the same as in qemu).

For convinience, to review these patches:

git checkout -b console_corruption 8d16201fe0e63afb5416a8eb7c6478f582ccccc0
git pull git://aeon.pipo.sk/libvirt.git console_dup

(The machine should be up most of time)


Peter Krempa (6):
  Add flags for virDomainOpenConsole
  virsh: add support for VIR_DOMAIN_CONSOLE_FORCE flag
  fdstream: Emit stream abort callback even if poll() doesnt.
  fdstream: Add internal callback on stream close
  util: Add helpers for safe domain console operations
  qemu: Add ability to abort existing console while creating new one

 configure.ac                   |   37 +++-
 include/libvirt/libvirt.h.in   |   12 +-
 src/Makefile.am                |    5 +-
 src/fdstream.c                 |   95 +++++++++-
 src/fdstream.h                 |   11 +
 src/libvirt_private.syms       |    6 +
 src/qemu/qemu_domain.c         |    5 +
 src/qemu/qemu_domain.h         |    3 +
 src/qemu/qemu_driver.c         |   21 ++-
 src/util/domain_safe_console.c |  399 ++++++++++++++++++++++++++++++++++++++++
 src/util/domain_safe_console.h |   28 +++
 tools/console.c                |    5 +-
 tools/console.h                |    3 +-
 tools/virsh.c                  |   18 ++-
 14 files changed, 614 insertions(+), 34 deletions(-)
 create mode 100644 src/util/domain_safe_console.c
 create mode 100644 src/util/domain_safe_console.h


More information about the libvir-list mailing list