qemu_vm: don't hide TestNAError exceptions

We have some code to automatically raise TestNAError (a "SKIP" test
result) if a QEMU feature is missing. But that code is being rendered
useless by a catch-all exception handling block around the
make_create_command() call.

Fix this by not hiding TestNAError exceptions from the caller.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
.gitignore: add cpuid_test_kernel binary

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
qemu_vm: add comma before CPU flags if necessary

Instead of strictly requiring cpu_model_flags to start with ",", add the
comma if necessary.

The commit that changed the code to always require commas broke most of
the "qemu_cpu" test cases. This should make them work again.

Cc: Xiaoqing Wei <xwei@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
qemu_cpu.cfg: create named variants for multiple QEMU versions

Keep only the "unknown QEMU version" variant enabled, but allow people
to enable other variants if desired.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
cpuid: convenience functions for logging

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
cpuid: always parse and convert CPUID dump to a dictionary

This will make it easier to analyze the CPUID dump data.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
cpuid: remove unnecessary exception-catching code

There's no need to raise a different exception if a test failed. Simply
pass the same exception to the caller and let the test runner take care
of it.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
cpuid: get_guest_cpuid(): allow extra VM creation parameters to be specified

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
cpuid: remove exception traceback code

There's nothing special about the cpuid test case that requires special
exception-handling code. If somebody needs a traceback from a test
exception, the generic virt-test test runner should be able to provide
it.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
cpuid: eliminate MiniSubtest class

There's no reason to create an additional test object and use confusing
tricks using __new__(), if we already have a test object as the "test"
parameter.

With this, we can convert all test classes to simple functions.

To make sure we kill the VM after running each test case, add
kill_vm=yes and kill_vm_gracefully=no to qemu_cpu.cfg.

Cc: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>