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>
virttest.standalone_test: Bring in funcatexit to standalone_test

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
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
Merge pull request #310 from ypu/cleanup

virttest.standalone_test: Bring in funcatexit to standalone_test
tests.virtio_console: Add boot_nr1 test

To make sure boot_nr tests are working correctly it's necessarily to boot
(and open) the port with nr=1.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
Merge pull request #315 from ldoktor/virtio_console

tests.virtio_console: Add boot_nr1 test