On 01/26/2012 10:16 AM, Peter Krempa wrote:
This patch adds support for the newly introduced
VIR_DOMAIN_CONSOLE_FORCE and VIR_DOMAIN_CONSOLE_SAFE flags. The console
command now has an optional parameter --force that specifies that the
user wants to forcibly interrupt an ongoing console session and create
a new one. Flag --safe requests that the console should be opened only
if the hypervisor driver supports safe console handling.
The behaviour to this point was that the daemon opened two streams to
the console, that competed for data from the pipe, and the result was
that both of the consoles ended up scrambled.
* tools/console.c:
- add support for flag passthrough
* tools/console.h:
- modify function prototypes to match impl.
* tools/virsh.c:
- add flag --force for the console command
What you have is good, but you should also add --safe and --force to
'virsh start --console' and 'virsh create --console'. Hmm, for virsh
start, naming it --force might be risky since we already have
--force-boot; there, I might go --force-console. It also means that if
we ever add unambiguous prefix option parsing, then --force would be
ambiguous; oh well.
+++ b/tools/virsh.pod
@@ -396,13 +396,19 @@ Configure a domain to be automatically started at boot.
The option I<--disable> disables autostarting.
-=item B<console> I<domain-id> [I<devname>]
+=item B<console> I<domain-id> [I<devname>] [I<--safe>]
[I<--force>]
Connect the virtual serial console for the guest. The optional
I<devname> parameter refers to the device alias of an alternate
console, serial or parallel device configured for the guest.
If omitted, the primary console will be opened.
+If the flag I<--safe> is specified, the connection is only attempted
+if the driver supports safe console handling. This flag specifies, that
s/specifies, that/specifies that/
+the server has to ensure exclusive access to console devices.
Optionally
+the I<--force> flag may be specified, requesting to disconnect any existing
+sessions. E.g in a case of broken connection.
s/sessions. E.g in/sessions, such as in/
/of broken/of a broken/
ACK. We can enhance 'start' and 'create' in a separate patch.
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org