summary refs log tree commit diff stats
path: root/scripts/qtest.py
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2018-06-06 17:55:26 +0100
committerEduardo Habkost <ehabkost@redhat.com>2018-06-22 15:01:15 -0300
commitc7dbff4b3a6655f4769e6d283f34191122450384 (patch)
tree838b2eec3542261ed06ce20e9c1c5ba22b7d602c /scripts/qtest.py
parent081492ca8ab23f90d56414595ecfd09ddbacb8f6 (diff)
downloadfocaccia-qemu-c7dbff4b3a6655f4769e6d283f34191122450384.tar.gz
focaccia-qemu-c7dbff4b3a6655f4769e6d283f34191122450384.zip
i386: improve sorting of CPU model names
The current list of CPU model names output by "-cpu help" is sorted
alphabetically based on the internal QOM class name. The text that is
displayed, however, uses the CPU model name, which is equivalent to the
QOM class name, minus a suffix. Unfortunately that suffix has an effect
on the sort ordering, for example, causing the various Broadwell
variants to appear reversed:

  x86 486
  x86 Broadwell-IBRS        Intel Core Processor (Broadwell, IBRS)
  x86 Broadwell-noTSX-IBRS  Intel Core Processor (Broadwell, no TSX, IBRS
  x86 Broadwell-noTSX       Intel Core Processor (Broadwell, no TSX)
  x86 Broadwell             Intel Core Processor (Broadwell)
  x86 Conroe                Intel Celeron_4x0 (Conroe/Merom Class Core 2)

By sorting on the actual CPU model name text that is displayed, the
result is

  x86 486
  x86 Broadwell             Intel Core Processor (Broadwell)
  x86 Broadwell-IBRS        Intel Core Processor (Broadwell, IBRS)
  x86 Broadwell-noTSX       Intel Core Processor (Broadwell, no TSX)
  x86 Broadwell-noTSX-IBRS  Intel Core Processor (Broadwell, no TSX, IBRS)
  x86 Conroe                Intel Celeron_4x0 (Conroe/Merom Class Core 2)

This requires extra string allocations during sorting, but this is not a
concern given the usage scenario and the number of CPU models that exist.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20180606165527.17365-3-berrange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'scripts/qtest.py')
0 files changed, 0 insertions, 0 deletions