virttest.utils_misc: Convert host_setup_flag into int

If host_setup_flag is set up in cfg files. Convert it to int in this
step. This can ignore the type error when use it for bit check.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
virttest.libvirt_storage_unittest: remove ModuleLoadCheckVirsh class.

Since we initialize a bogus_virsh in setup to provide a fake virsh for unittest,
then there is no need to skip if virsh command is not available.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Merge pull request #833 from yangdongsheng/libvirt_storage_unittest

virttest.libvirt_storage_unittest: remove ModuleLoadCheckVirsh class.
virt-libvirt: Error message enhancement

It's possible to install libvirt bits w/o installing kvm or xen.  This
will be reflected in 'virsh capabilities' output, but the VM class just
reports a key error.  Added two specific error logging messages to make
the problem clearer, but continue to raise the original exception.

Signed-off-by: Chris Evich <cevich@redhat.com>
tool-pep8: update the comment in run_pep8 module.

Options of run_pep8 tool is changed, then the description
should be updated at the same time.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Mass docstring fix

Make virt-test to have a docstring style mostly compliant with
the sphinx's [1] format, reStructured text. This means that
we have to trade all '@' tags to be ':', mostly.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
tools/run_pep8: Add own logging config class

This way we can keep those scripts in sync among
virt-test and autotest.

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

This file is also borrowed from autotest, and already
reflects the updates to the coding style of the projects
under the autotest umbrella.

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

Fix some extra problems with docstrings in the code tree.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #832 from ypu/host_setup_flag

virttest.utils_misc: Convert host_setup_flag into int
qemu.test: fix module reload failed issue

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.test.cfg: Add cmd /c for windows disk write test

Add cmd /c to let the cmd session wait util the autoit scripts finished.
Otherwise it will return immediately after the autoit scripts start.
Also correct the script name.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
qemu.test.cfg: Add two sub test for windows disk write

Run CrystalDiskMark in guest during s3 and s4.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
run: Docstring fix

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.qemu_vm: But fix in add_pcidevice.

This patch will fix following issue:

"qemu: -device pci-assign,host=06:00.1,id=id_06:00.1:
 Parameter 'id' expects an identifier\n"

Also correct parameter in add_pcidevice function call.

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest.qemu_vm: generate mac address if not available in nic and add vf with mac

Now we need set mac for vf before using it. Or guest could not get IP.

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

We have update vm.pci_assignable.request_devs() function call.

Now we need create device dict and use it in request_devs().

We need set device["type"], device['mac'] (for vf), device["name"] (optional)

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

We have update vm.pci_assignable.request_devs() function call.

Now we need create device dict and use it in request_devs().

We need set device["type"], device['mac'] (for vf), device["name"] (optional)

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>