qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 4/5] scripts/qemu.py: introduce set_console()


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH v2 4/5] scripts/qemu.py: introduce set_console() method
Date: Tue, 29 May 2018 10:19:50 -0300
User-agent: Mutt/1.9.2 (2017-12-15)

On Tue, May 29, 2018 at 09:01:42AM -0400, Cleber Rosa wrote:
> On 05/26/2018 12:54 AM, Philippe Mathieu-Daudé wrote:
> > Hi Cleber,
> > 
> > On 05/25/2018 03:42 PM, Cleber Rosa wrote:
> >> The set_console() method is intended to ease higher level use cases
> >> that require a console device.
> >>
> >> The amount of intelligence is limited on purpose, requiring either the
> >> device type explicitly, or the existence of a machine (pattern)
> >> definition.
> >>
> >> Because of the console device type selection criteria (by machine
> >> type), users should also be able to define that.  It'll then be used
> >> for both '-machine' and for the console device type selection.
> >>
> >> Users of the set_console() method will certainly be interested in
> >> accessing the console device, and for that a console_socket property
> >> has been added.
> >>
> >> Signed-off-by: Cleber Rosa <address@hidden>
> >> ---
> >>  scripts/qemu.py      |  97 +++++++++++++++++++++-
> >>  scripts/test_qemu.py | 186 +++++++++++++++++++++++++++++++++++++++++++
> >>  2 files changed, 282 insertions(+), 1 deletion(-)
> >>  create mode 100644 scripts/test_qemu.py
> >>
> >> diff --git a/scripts/qemu.py b/scripts/qemu.py
> >> index 7cd8193df8..f099ce7278 100644
> >> --- a/scripts/qemu.py
> >> +++ b/scripts/qemu.py
> >> @@ -17,19 +17,41 @@ import logging
> >>  import os
> >>  import subprocess
> >>  import qmp.qmp
> >> +import re
> >>  import shutil
> >> +import socket
> >>  import tempfile
> >>  
> >>  
> >>  LOG = logging.getLogger(__name__)
> >>  
> >>  
> >> +#: Maps machine types to the preferred console device types
> > 
> > This could be QMP query-able...
> > 
> 
> I'm not an expert here, but IIRC Eduardo thinks that the best solution
> may be for these machine types to implement support for "-serial"
> instead.  When all machines do that, then this "set_console()" would
> default to adding a "-serial" argument if no device type is given.

Both 'query-machines' and '-serial' would be good solutions for
this, IMO.  But I don't think this should block the inclusion of
avocado_qemu.

> 
> >> +CONSOLE_DEV_TYPES = {
> >> +    r'^clipper$': 'isa-serial',
> >> +    r'^malta': 'isa-serial',
> >> +    r'^(pc.*|q35.*|isapc)$': 'isa-serial',
> >> +    r'^(40p|powernv|prep)$': 'isa-serial',
> >> +    r'^pseries.*': 'spapr-vty',
> >> +    r'^s390-ccw-virtio.*': 'sclpconsole',
> >> +    }
> >> +
> >> +
[...]

-- 
Eduardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]