[libvirt] [PATCH 00/10] Console coruption with two or more clients series

Daniel P. Berrange berrange at redhat.com
Tue Oct 18 10:34:50 UTC 2011


On Wed, Oct 12, 2011 at 03:43:10PM +0200, Peter Krempa wrote:
> 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 libvirt iohelpers are spawned on the same time that compete for data 
> from the pty. This causes that each of the consoles get scrambled and 
> unusable.
> 
> Patches
>   fdstream: Emit stream abort callback even if poll() doesnt.
>   virnetclientstream: Propagate stream error messages to callback
>   daemon: Subscribe the stream event callback for error events.
> 
> add the ability to abort a stream from the daemon side.
> 
>   fdstream: Add internal function to check if a fdstream is open
> This patch adds a helper function that checks internally if a fdstream 
> is open and working.
> 
>   virsh: fix console stream error reporting
>   Add flags for virDomainOpenConsole
>   virsh: add support for VIR_DOMAIN_CONSOLE_FORCE flag
> This patches add instrumentation to virsh that supports the new ability to 
> abort streams from the daemon side and adapts the console callback to handle 
> this. These patches also add a new flag set for virDomainOpenConsole API
> call that allow users to control the if the existing console connection should
> be left in place or killed in favor of the new one
> 
>   qemu: Add ability to abort existing console while creating new one
>   lxc: Add ability to abort existing console when creating a new one
>   uml: Add ability to abort existing console when creating a new one
> These patches modify the hypervisor drivers so that they are aware of existing
> console connections and refuse to create a new one (or kill the old).
> 
> The xen driver also supports console in a similar way like the previously
> mentioned drivers, but lacks the means to store a stream reference
> permanently. I'll look in if it's possible to modify this driver to support
> this new functionality.

The problem with doing the  console checks by looking for an in use
virStreamPtr is that it only solves it for apps using libvirt. If
someone connects using 'xm console' or 'minicom' then we're not
protected.

The traditional way to protect PTYs from concurrent usage is to place
a lock file in /var/lock with a special standardized naming scheme.
Should we perhaps be doing that instead ?

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list