libvirt: Add test module for virsh domblkinfo.

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
virt: Add virsh function for virsh domblkinfo.

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
virt: Add get_disk_source() for virsh domblkinfo.

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
libvirt: fix a bug for virsh domblkinfo

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
libvirt: Avoid size check if disk format isn't 'raw'.

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
virt: fix problem of checking persistent in virsh.net_state_dict().

When network is transient, net_autostart() will raise.
The next step will try to get "transient" in result_object.
While error messages may not be in stderr but exist in result
object indeed:

 * Command:
 net-autostart default --disable
 Exit status: 1
 Duration: 0
 stdout:
 error: failed to unmark network default as autostarted
 error: Requested operation is not valid: cannot set autostart
        for transient network

Message "transient" exists, but stderr is None.
So search "ranient" in whole result object will be more suitable.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virt-libvirt: Add test module for virsh net-define|undefine.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virttest/qemu_vm:Fix unable to add nodefaults qemu command line

has_option(help_text, "use_nodefaults") will always return false because
qemu help_text just has 'nodefaults' line, instead of 'use_nodefaults'.
So -nodefaults will never be used as qemu command line.

This patch is to avoid this error situation

Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
Merge pull request #280 from yumingfei/virsh_net_define_undefine

virt-libvirt: Virsh net define undefine pull request #280
qemu.enospc:update the test.bindir to data_dir.get_data_dir

Now use test.bindir will not find the image file, just update it
to new interface data_dir.get_data_dir

Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
Merge pull request #444 from QiuMike/qemu.enospc_update_the_test.bindir_to_data_dir.get_data_dir

qemu.enospc:update the test.bindir to data_dir.get_data_dir
Merge pull request #435 from QiuMike/virttest_qemu_vm_Fix_unable_to_add_nodefaults_qemu_command_line

virttest/qemu_vm:Fix unable to add nodefaults qemu command line
Merge pull request #318 from liyangfnst/domblkinfo

Add test for virsh domblkinfo v4
virttest.qemu_storage: FIX Don't overwrite backup image during preprocess

After the test during check_image the backup image was still being
overwritten.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
utils_net : Add the lost api in utils_net

This patch add the lost APIs in utils_net, something wrong happended
when rebase the patch(commit 9efb355).

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
virttest.qemu_vm: Add get_monitors_by_type() function

This function can be used to get monitors of the given type.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
qemu.tests.qmp_*: Use VM.get_monitory_by_type() function

Use VM.get_monitory_by_type() function to get QMP monitor(s).

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
qemu.tests.qmp_event_notification: Fix config main_monitor

The main monitor name is overriden to hmp1 and causes test failures...

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
qemu.tests.qmp_*: Pylint/style changes

No actual changes.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
Revert "virttest.qemu_vm: Add freq option to usb device"

This reverts commit fadf99e6c0b1bdd86315040b3d3a35a804a550e8.

The freq option was removed in commit:
https://github.com/autotest/autotest/commit/93acc8819c8d912f2f3bf6f4d5d66bc2c99181a4
Thus revert this commit from virt-test.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>