virt: update PciAssignable class

Fix some bugs in this class.
Add new function get_vf_status add_device
Use error.context in this class.
Make it works with multi vms.
Now it also support assign pf vf together.

Signed-off-by: Feng Yang <fyang@redhat.com>
cfg: update configure for vf_assignable in guest-hw.cfg.sample

To set more sr-iov device, please use nics += "nic2 nic3"
Add some new parameters pf_filter_re, vf_filter_re, mac_ip_filter,
mac_changeable
Delete devices_requested.

Signed-off-by: Feng Yang <fyang@redhat.com>
kvm_vm.py Redesign sr-iov part code

After this patch, we can configure sr-iov device in the
same way as nic device. So older test case could run
with sr-iov device.

Changes from v1:
Recreate the patch accroding latest next tree.

Signed-off-by: Feng Yang <fyang@redhat.com>
kvm: Add update_mac_ip_address function to utils_test.py

Current guest ip finding mechanism could not work for
sr-iov device.
This  function could login guest with serial, then get
guest ip.
Sometime sr-iov device in guest could not get ip, we have to
restart network in guest.
Also add find_substring function.

TODO:
this function only works when guest support serial,
we need a smarter way to get guest ip when sr-iov device used.

Signed-off-by: Feng Yang <fyang@redhat.com>
env_process.py: Call update_mac_ip_address if mac_changeable is yes

Set mac_changeable to yes in sr-iov testing,
then update_mac_ip_address called to get guest's ip and mac.

Signed-off-by: Feng Yang <fyang@redhat.com>
utils_misc.py: Add default value for qemu_path in qemu_has_option()

Set default value to /usr/bin/qemu-kvm

Signed-off-by: Feng Yang <fyang@redhat.com>
virt_vm.py: Handle exception in needs_reboot()

Restart the guest if exception raised

Signed-off-by: Feng Yang <fyang@redhat.com>
kvm: Add sr_iov_hotplug.py test script

This script cover sr-iov hotplug test cases.

Changes from v1:
Delete useless line and module.

Signed-off-by: Feng Yang <fyang@redhat.com>
kvm: Add sr_iov_hotunplug.py test script

This script cover the test that hot unplug the original pci device
which is added in qemu command.

Changes from v1:
Delete useless code.
Now this case could not work for rhel5 host.
So delete pci_del part code which only works in rhel5 host.

Signed-off-by: Feng Yang <fyang@redhat.com>
cfg: Add sr-iov part new cases in subtest.cfg.sample

Signed-off-by: Feng Yang <fyang@redhat.com>
Fix bug of virsh_define test module.

 new_from_dumpxml() in libvirt_xml.VMXML will not update
 its instance automatically.
 vmxml.new_from_dumpxml(vm.name, virsh)
                =>
 vmxml = vmxml.new_from_dumpxml(vm.name, virsh)

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virt-kvm: Fix config default image_boot bug

Signed-off-by: Chris Evich <cevich@redhat.com>
virttest: Move KojiClient code to utils_koji

In our quest to clean up utils_misc, move all koji related
code to utils_koji, and change all the users accordingly.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest: Introduce build_helper library

Move all build helpers (used in the build test) to their
own library, 'build_helper', and modify users in the code
accordingly.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest: Add libraries utils_env and utils_params

Containing the Env and Params classes.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
standalone_test: Use data_dir.get_root_dir()

Rather than repeating the code to locate the root dir
in the standalone_test module.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest: Turn env version into a module attribute

with an appropriate getter method, and replace this in
the autotest wrapper module and stand alone test module.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
utils_test: Fix usage of cgroup library not present on autotest 0.14

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest: Introduce propcan library

Create a specialized library to hold the PropCan class,
with a separate unittest file.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
xml_utils: Fix buggy list comprehension

c is not defined. Let's use good ol' iteration to accomplish
the original idea of the method.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>