openvswitch: Remove unneeded import
virttest: Add bootstrap library

In order to organize our shared libraries better, we
have to slowly take functions from utils_misc and move
to other smaller, more specialized libraries. Let's
start by doing this with the bootstrap code [1], and
move it to a library called 'bootstrap'.

[1] Code that copies the correct config sample files
to the right places, as well as verifies whether the
JeOS image is available.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
utils_misc: Clean unused imports

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
data_dir: Add get_tmp_dir()

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
passfd_setup: Make temporary passfd object files to be generated on tmp

Pass the test suite's tmp dir to the build process of the
passfd c module, so the temporary object files does not
go to the virttest dir.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt-libvirt: Fix None id/uuid bug

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Fix libvirt_xml virsh_instance default

* Fix check for type of virsh_instance parameter
* Default virsh_instance parameter to virsh module
  (needed for backward compatibility)
* Fix os_arch_machine_map bug

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Clarify XML problems

* Make virsh.dumpxml raise exception instead of returning ''
* Make XML parsing errors clearer by printing XML filename/string

Signed-off-by: Chris Evich <cevich@redhat.com>
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>