virttest.qemu_vm: PEP8 fixes

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.test_setup: PEP8 fixes

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.qemu_devices: Use the bus function to check if it matches the spec

When we try to match a bus to some specification (dictionary) it makes
sense to ask the bus and not to try to guess. This way we can customize
the function to each bus, if necessarily.

Additionally make it possible to ignore autotest type by setting
atest=False. This could be used to see if this specification matches from
qemu point of view, but doesn't match from autotest point of view.
(from qemu point of view ahci and ide bus is the same, but in autotest
we want to make sure the ide-hd goes into the correct HBA). This feature
will be used in the following patch.

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

Conflicts:
	virttest/qemu_devices.py
virttest.qemu_devices: Differentiate between qemu and autotest bus type

qemu doesn't differentiate between some of the buses, which are
differentiated in autotest (eg. ahci and ide disks belongs simply
to IDE bus type). In order to be able to distinguish between those
buses we need to add atype (=autotest type) of the bus.

This patch makes this change only for images, where were problems
caused by different qemu/autotest behavior. If this concept prooves
to be right, we can use it to distinguish between various kinds of
USBs in order to reflect the qemu behavior while keeping the autotest
standards.

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

Conflicts:
	virttest/qemu_devices.py
virttest.qemu_devices: Fix broken addr_spec of QSCSIBus

There were changes in QSCSIBus which now accepts only addr_lengths
instead of full addr_spec. Update the images_define_by_variables()
function to suit current behavior.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_devices: Always set port in QUSBBus

USB buses behaves realy weird and always assigns different port
when hotplug/unplug is used. Always set port of the device to
make sure it is in the correct slot.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_devices: Fix ich9-usb-ehci device creation

There is a hook to create ich9-usb-ehci from multiple devices. Anyway
the device was not plugged into qdev PCI representation thus another
device might use the same address.

qemu_devices still doesn't support x.y PCI address thus plug only
ich9-usb-uhci1 device into this PCI representation into address
0x1d to occupy this slot.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_storage: Improve error message

Log also which image_filename failed. It's not easy to find this
information as cleanup messages are logged after this failure.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
qemu.tests.multi_disk_random_hotplug: Add new test

This tests the disk hotplug/unplug functionality.
 1) prepares multiple disks to be hotplugged
 2) hotplugs them
 3) verifies that they are in qtree/guest system/...
 4) unplugs them
 5) verifies they are not in qtree/guest system/...
 6) repeats $repeat_times
 *) During the whole test stress_cmd might be executed

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