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>
virttest.qemu_vm: set global_image_bootindex to 1 when using -kernel

As -kernel option should take the bootindex 0, so we should make
global_image_bootindex for images bootindex count start from 1.

Signed-off-by: Yiqiao Pu <ypu@redhat.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>
guest-os: Change kickstart/unattended parameters passed to kernel

With recent changes in the QEMU VM code, the cdrom order
is not honored anymore. Let's change the linux guests
configuration to honor that change.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
tests/autotest_control.py: simple identation fix

Signed-off-by: Cleber Rosa <crosa@redhat.com>
virttest/utils_test.py: allow running autotest tests with standalone control files

This fix is needed when running tests on vms based on the autotest
client, when using control files that do not use job.run_test() and
similar calls. That is, the control files are standalone and do not
reference a client test.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
virt: introduce autotest_distro_detect test

This is a trivial test that exercises the recently added distro.py
module on autotest.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
qemu.tests: Bring back missing tests code in cdrom.py

Some test code in this script was deleted by accident in
commit 2b5e0f6151419dd403d7f959e0492510f790b8e0. This patch
brings them back.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests: Add a kvm subtest format_disk.

This test will simply create a file system on disk, mount it and write
a file with some content to the disk. Check whether the write could be
succeeded.

Signed-off-by: sshang <sshang@redhat.com>

Checking guest os type with 'guest_name' parameter may not
always work for all guests, and not supported by upstream.
Thus update all these places to using 'os_type'.

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

In the format disk test, the status of the harddisk is different in different
env in Windows guest. Should check if the disk plused is offline and writeable.

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

This patch try to fix all the tab and trailing space problems.

Signed-off-by: Jason Wang <jasowang@redhat.com>

Make command timeout of format_disk.py scirpt longer and configurable

Signed-off-by: Feng Yang <fyang@redhat.com>
virt: Adds support for new qemu-kvm -cpu interface.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Add get_iface functions for libvirt_xml module.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virt-libvirt: Add test for virsh attach|detach interface.

Signed-off-by: Yu Mingfei <yumingfei@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>
libvirt_vm: give a choice on starting serial console automatically.

In start()&create() of VM class, they will start
serial console automatic when vm is started.
It will prevent other test from using console.
So give a choice on starting serial console automatically.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virt-libvirt: Standardize VMXML device package module handling

Signed-off-by: Chris Evich <cevich@redhat.com>