virttest: Restore the working dir in download_test_provider

After check the repo informations we should restore the working
dir to original one. Otherwise it will cause problems after we
call it in our scripts.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
virt: Add clone_volume func to PoolVolume class

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
virt: Add create func to VolXML class

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
virt: Add functions to get/set cpu status

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
utils_libvirtd: Don't need to wait if start failed

If libvirtd service start or restart failed, just checking the exit code
will be enough, we don't need to wait 60 seconds to check whether a
virsh command can be executed.

Signed-off-by: Hao Liu <hliu@redhat.com>
libvirt: Declare LIBVIRT_DEFAULT_URI in preprocess().

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
env_process: Recreate vm in env if vm.connect_uri is not params.get('connect_uri').

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libvirt_vm: Override __setattr__ of libvirt_vm.VM.

For VMs in different uri, we need some different params for them.
This patch introduce a way we can set these params in base.cfg only
for VM in a special uri. What we need to do is adding the special
param with a prefix of 'libvirt_URI_' into base.cfg. That's all.
libvirt_vm.VM will check the connect_uri and use the param you want.

Example:
	isa_serial = "serial0" is not usable for lxc VM. lxc does
not support serial device yet. In this case, we need not to change
the default value of isa_serial. We can add a new param in base.cfg.
	libvirt_lxc_isa_serial = "console0"
Then if your VM is a lxc guest, it will use "console0".

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
run: Introduce an option --connect-uri to assign uri for test.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Add APIs: fill, fill_dir, strings, head, head_n, tail, pread, ls
libvirt: adapt the default_tests.cfg to new framework of test-provider.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
virt: Add a func to make filesystem on partition

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
Merge pull request #1730 from yangdongsheng/default_tests

libvirt: adapt the default_tests.cfg to new framework of test-provider.
virt: Fix a bug in Iscsidev init func

Set 'self.emulated_image' to be a true file, if not
cleanup cannot find the emulated_image file.

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
Merge pull request #1734 from liyangfnst/iscsi_fix

virt: Fix a bug in Iscsidev init func
Fix a bug in Iscsi.export_target func

If emulated_image already exists, but size is different with
you want, we must rebuild this file, if not, test will fail.

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
Merge pull request #1692 from yangdongsheng/lxc_2

[Part 2] Declare  LIBVIRT_DEFAULT_URI in preprocess()
Merge pull request #1735 from liyangfnst/emulate

Fix a bug in Iscsi.export_target func
Merge pull request #1712 from liyangfnst/cpu_enable

virt: Add a func to enable/disable cpu
Merge pull request #1709 from liyangfnst/clone_vol

virt: Add clone_volume func to PoolVolume class