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>
qemu: Fix utils.system_output() calls incompatible with at 0.14

In some places of our code, we're calling utils.system_output
with a parameter verbose, introduced in autotest 0.15. Therefore,
for people using the Fedora/RHEL shipped RPMs, a bug will
happen since the API on their RPMs doesn't know about the verbose
param.

Therefore, remove such calls and get the equivalent construction
using the utils.run API, that does support the parameter.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.qemu_vm: Make add_pcidevice works with new qdev interface

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.tests: make sr_iov_hotplug_negative.py works with new PciAssignable class

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.tests: Make sr_iov_hotplug.py works with new PciAssignable class

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.tests.cfg.sr_iov: Config update.

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest.test_setup:Add pf_vf_info element and get_pf_vf_info function into PciAssignable

get_pf_vf_info() will get following pf information:
    pf_id: The id of the pf device.
    occupied: Whether the pf device assigned or not
    vf_ids: vf device id list of this pf.
    ethname: network device interface name in host for this pf.

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest.test_setup: Add get_vf_num_by_id() function to PciAssignable class

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest/test_setup: Update _get_pf_pci_id() function.

Get the PF PCI ID from self.pf_vf_info.
Return the first available PF if name is not set.

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest:test_setup: update get_vf_devs() and get_pf_devs() function

get requested vf or pf from self.pf_vf_info list.

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest.test_setup: Update PciAssignable class

In this patch have following update:
1. Delete self.type_list and introduce self.devices.
2. Update add_device() to support mac setting for VF.
3. Update get_devs() to use new get_vf_devs() and get_pf_devs().
4. Update kvm parameter by echo to /sys folder.
5. Support set mac for VF.
6. Update the way used to update kvm module parameter.

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest.test_setup: Change docstring from Doxygen to sphinx in PciAssignable class

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest: Support vfio for pf/vf pci assign

Also add new function get_same_group_devs() to get devices in same
group.

Get device's driver from /sys/bus/pci/devices/[device id]/driver

Signed-off-by: Feng Yang <fyang@redhat.com>