libvirt: Add test module for virsh {at|de}tach-disk

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
virt: Modify virsh function for virsh {at|de}tach-disk

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
virt: Add get_disk_count() for virsh {at|de}tach-disk

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
qemu_vm.py: increase the vm creation timeout

Because some old versions of qemu-kvm take more than we'd like to
initialize, and this is not a bug or one that will be fixed.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
qemu: Add macvtap support

This patch introduces using macvtap nic in test, when using
macvtap nic better have a switch support macvtap, if not,
need have a host with two nic devices when using this patch.

if you want to use macvtap in your test, just configure
"nettype = macvtap" in your .cfg file, or provide
--nettype macvtap as a flag for the virt test runner.

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
Merge pull request #300 from clebergnu/timeout_create
Implement nmi function in monitor

both HMP and QMP
Changlog:
use self.cmd() on QMP monitor

Signed-off-by: Xiaoqing Wei <xwei@redhat.com>
Acked-by: Lukas Doktor <ldoktor@redhat.com>
Update kdump case to use vm.monitor.nmi()

This would prevent case error when test with QMP
as it uses 'inject-nmi' instead of 'nmi'

Signed-off-by: Xiaoqing Wei <xwei@redhat.com>
Acked-by: Lukas Doktor <ldoktor@redhat.com>
qemu.tests.cgroup:modify the way to calculate the cpu counts

Modify code to catch the word 'processor' rather than 'model name'
in /proc/cpuinfo to count cpu number. Becasue the Power cpu haven't
the 'model name' field, and both x86 and Power cpu has the
'processor' field.

Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
Signed-off-by: Liu Sheng <liusheng@linux.vnet.ibm.com>
qemu.tests.time_manage:Fixed VM names error

Currently, the VM names has changed to like virt-tests-vm1 style.
But the VM names in test case time_manage are still the old version

Modify the VM names to the new style so the test case pass.

Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
Acked-by: Feng Yang <fyang@redhat.com>
qemu.tests.enospc: Fixed 'fuser -k' failed bug

Currently, when running the tests while the clean
up didn't run on the previous, it will raise an
error like:

Test failed: CmdError:
Command <fuser -k /dev/vg_kvm_test_enospc/lv_kvm_test_enospc>
failed, rc=1, Command returned non-zero exit status
[context: performing enospc setup --> performing enospc cleanup]
* Command:
    fuser -k /dev/vg_kvm_test_enospc/lv_kvm_test_enospc
Exit status: 1
Duration: 0.0501132011414

That is the link /dev/vg_kvm_test_enospc/lv_kvm_test_enospc
exist, but no user. thus the command line:
    fuser -k /dev/vg_kvm_test_enospc/lv_kvm_test_enospc
will return 1(fuser will always return none-zero for nobody use).

So just ignore the return status of the fuser.

Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
virt.qemu.tests.nic_bonding:Fix vm.netdev_id error

Nowadays, netdev_id has been a part of nic, and not
belongs to the vm object anymore.

At the sametime nic already has the key 'device_id', so
use nic.device_id is OK.

Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
Acked-by: Feng Yang <fyang@redhat.com>
virt:Make the clock_getres to support POWER guest

The name of the clock on Power guest is "timebase" which is
different from it counterpart in x86 "kvm-clock"

To makes it can work in both Power and x86 guest, add the
platform check.

Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
Merge pull request #304 from liyangfnst/attach_detach_disk

Add test for virsh {at|de}tach-disk
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>