On Fri, Mar 01, 2019 at 11:55:13AM +0100, Cornelia Huck wrote: > On Wed, 20 Feb 2019 19:57:46 -0500 > Cleber Rosa <cr...@redhat.com> wrote: > > > The set_console() utility function traditionally adds a device either > > based on the explicitly given device type, or based on the machine type, > > a known good type of device. > > Hm, I find this sentence hard to parse... maybe it should be "either > adds a device..." and "adds a known good type of device"? >
OK, sounds good, but I may change it a little bit given that you following feedback made me change (positively) a lot here. > > > > But, for a number of machine types, it may be impossible or > > inconvenient to add the devices my means of "-device" command line > > s/my/by/ > Same here. > > options, and then it may better to just use the "-serial" option and > > let QEMU itself, based on the machine type, set the device > > accordingly. > > > > To achieve that, the behavior of set_console() now flags the intention > > to add a console device on launch(), and if no explicit device type is > > given, and there's no definition on CONSOLE_DEV_TYPES, the "-serial" > > is going to be added to the QEMU command line, instead of raising > > exceptions. > > > > Based on testing with different machine types, the CONSOLE_DEV_TYPES > > is now being set to the bare essential entries (one entry to be > > honest), for machine types that can not easily give us a working > > console with "-serial". > > > > Signed-off-by: Cleber Rosa <cr...@redhat.com> > > --- > > scripts/qemu.py | 39 +++++++++++++++++++-------------------- > > 1 file changed, 19 insertions(+), 20 deletions(-) > > > > diff --git a/scripts/qemu.py b/scripts/qemu.py > > index ee85309923..bd1d2e2b9a 100644 > > --- a/scripts/qemu.py > > +++ b/scripts/qemu.py > > @@ -42,11 +42,6 @@ def kvm_available(target_arch=None): > > > > #: Maps machine types to the preferred console device types > > 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', > > FWIW, s390x has supported the '-serial' parameter since 3.0 (commit > 052888f043bacb18231046045b1f9cd946703170). Maybe you can drop this now? Yes, thanks for pointing that out! I'm simplifying the set_console() behavior and dropping the CONSOLE_DEV_TYPES dict completely. > If not, what error are you getting? No errors, it seems to work great now. - Cleber.