virttest.qemu_devices: Add qemu_devices and use it for qemu VM

This patch modifies the way how qemu_command is created. Instead
of long string it creates a representation of devices, which behaves
similarily to qemu's qdev.

Current implementation is very limited and only handles PCI bus. All
devices are created as simple StringDevices so the benefit might
not be obvious. But later patches adds specific devices (usb, image,
...) and their specific behaviour.

Additionally this patch adds the basic support for q35 machine.

Later the support for automatic check of running VM and representation
will be added.

NOTE: This version's pci addresses are not assigned properly as
      upstream currently uses different method. Following patch
      removes the original mechanism and uses the one from this patch.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_vm: Eclipse autoformat
virttest.qemu_vm: Use devices to handle supported devices/commands

This patch makes VM.make_create_command use devices.has_device()
and devices.has_option().

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_vm: Handle PCIs by qemu_devices

This patch adds two types of qemu_devices and uses them for PCI
devices. The addr and bus items are handled by qemu_devices bus.

New config option is also introduced:
    strict_mode(bool): which enforce setting optional parameters
                       (bus, addr, ...)

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_devices: Various fixes

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
shared.cfg.machines: add support for q35 machine type

This patch adds support for q35 machine type.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
shared.cfg: Remove unused config

init_pci_addr is non existing parameter.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_vm: FIX handle help_text by devices

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_devices: Use itertools instead of joined_iterators

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_devices: Use utils.system_output() instead of commands

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_devices: Fix docstrings

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_vm: Fix chardev's options

chardev option should be wait instead of nowait and it requires
backend to be specified.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.env_process: Fix problem with VM recreation

When start_vm was False, VM was not recreated, only params were
updated. Anyway when create() was called it didn't detect this
change and executed the previous command instead.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
qemu.tests.qmp_command: Fix and update qmp_cpu

This test previously only checked, if any CPU contains 'current=True'.
With this patch it goes through all cpus and checks, whether the
'current=True' is set only for the last CPU.

Additionally this verification method works with all smp setups.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
qemu.tests.qmp_command: Pylint and Eclipse fixes

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
qemu.tests.qmp_command: Repair function call of has_option()

qemu_command has to be passed to qemu_has_option() function.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
qemu.tests.qmp_command: Add quotes around outputs

Quite often the only difference between HMP and QMP monitor
output is missing or additional space. Add '' around outputs
to help finding those bugs.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.build_helper: Introduce tag checkout and tag sign verification

Sometimes we want to check qemu from a git tag, that allows
us to verify whether the code we are downloading actually
comes from the repository owner.

Introduce this support to our git helper. If for some reason
this verification fails, be merciless and fail the entire
build test.

CC: Michael S. Tirskin <mst@redhat.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
qemu.tests.ksm_base: All KSM tests requires root

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
qemu.tests.ksm_base: Pylint fixes

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>