qemu.test : add some test for cpu_hotplug

Add cpu_hotplug test support in autotest.

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
virttest.qemu_devices: Support for old qemu ide disks

Older qemu versions (RHEL6) doesn't support ide-hd and ide-cd.
Use ide-drive instead.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
qemu_cpu.cfg: remove "no 486" line

I don't know why 486 was being excluded, as the CPUID instruction really
works, and QEMU has CPUID data being set for 486, too. The tests keep
working after removing the "no 486" line from the config file.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
qemu.tests: fix some small bugs

1). update pre_command: used scsi_debug parm to add_host instead write
sys filesystem to avoid device create delay;

2). fix passthrough scsi device cache to writethrough to avoid fail to
open /dev/sg* when drive_cache=none; do this because /dev/sg* is
emulated by scsI_debug module, backend of these device is memery, open
with O_DRIECT is not supported;

3). removed useless import module 'qemu_monitor'

Signed-off-by: Xu Tian <xutian@redhat.com>
virttest.qemu_devices: Correct English spelling

Correct bad English spelling and typos.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_devices: Set port of the last usb device

When last device should be appended to usb bus, qemu automatically
add usb-hub to keep free ports for additional devices. We don't want
this in autotest as all tests use strict amount of usb buses. By
enforcing the last item's port we avoid this behavior.

Signed-off-by: Lukáš Doktor <ldoktor@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>
virttest.qemu_devices: Divide 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>