libvirt.tests: Fix parameter error of migrate-setmaxdowntime.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
snapshot_create_as: Fix negative test with quiesce without ga on running domain

As qemu-guest-agent change, start and stop the ga process differ
in different guest os. On RHEL7 and fedora, as take over by
systemd, it could be autostarted when os up, kill the process
could fail as new process be started immediately. So for stop it,
first try to kill the process, if process still detected, then
use systemctl to stop the service.

Update TestFail to TestNAError when check qemu-guest-agent
service.

This fix issue:
https://github.com/autotest/tp-libvirt/issues/135

Signed-off-by: Wayne Sun <gsun@redhat.com>
virsh_change_media: Add a case to cover floppy write & read test

Signed-off-by: Yanbing Du <ydu@redhat.com>
virsh_update-device: case expand and tiny bugs fix

1. Support different disk type: cdrom, floppy
2. Support different disk mode: none, readonly, shareable
3. Cover more sub test cases
4. Tiny bugs fix

Signed-off-by: Yanbing Du <ydu@redhat.com>
Add VG related test case
libvirt.tests: Fix migrate stress problems.

 * Vms will be popped in cross migration, so creating them again
   for cleanup.
 * If local vms use lan, geting address would be failed on remote
   host, so storing ips before migration.
 * Fix stress_args parameter.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
Add test case for vg_activate, vg_activate_all, vglvuuids, vgpvuuids
libvirt.test: Raise TestNAError if option not be supported

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
libvirt.test: Fix a bug for update-device test

Disk maybe doesn't contain source element, use
'disk.source' will get LibvirtXMLNotFoundError.

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
snapshot_create_as: Add autodestroy negative case

Add negative test case for snapshot on created autodestroy domain.

Signed-off-by: Wayne Sun <gsun@redhat.com>
libvirt_bench: make ttcp_from_guest_to_host works for vms rather than only for main_vm.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
snapshot_create_as: Add test case for "snapshot=no" in diskspec option

When snapshot=no given in diskspec, the specific disk will not be taken
snapshot. For support this, check "snapshot=no" in compose_disk_options
function and update cfg file.

Signed-off-by: Wayne Sun <gsun@redhat.com>
tests.migrate_stress: Set autologin for remote host.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virsh_blockcopy: Adjust lookup of mirror in check_xml

In libvirt 1.2.6 the <disk> .. <mirror> element is changing to accomodate
new forthcoming features for blockcopy/blockcommit code (to allow network
copy/commit).  This resulted in a change to the XML output during block
operations. Although back-compat features will keep the "file" attribute
within the <mirror> element - the (now) redundant, but yet desired action
will be to check a new <mirror> attribute "type" in order to determine
how to process a new <source> subelement of <mirror>.  For a "file" the
<source> element will contain the (now) duplicated "file" and "format"
attributes.  For other "type" attributes, the <source> element's attributes
will differ.

This PR will just make use of the new format for 1.2.6 and beyond.  Test
augmentation to perhaps handle block and network block commits is left for
future changes.
tests.migrate_stress: Do not check IP in cross migration.

In cross migration, vm in list may be migrated back after pairs of
migration and it's not easy to track them, so skipping IP checking here.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virsh.setvcpus: fix remote test

The variables error and status_error should be configured before the
try-except block as they must exist always when it comes to return.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
virsh.vcpucount: fix 'guest_option' test case

There was a missing option whether we are running 'guest_option' test
case to properly start a guest agent in the guest.

I've also properly updated the first occurrence of that condition.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
test.volume_application: Fix vm process error.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
test.volume_application: Fix installation problems.

 * As this line in unattended_install module:
   [vm = env.get_vm(params["main_vm"])]
   It needs 'main_vm' and a VM object for a new installation.
   So new vm should be registered to env.
 * Unattended_install sets kickstart ISO to /dev/sr0 as default.
   So changing the cdroms order to fit this.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
Merge pull request #146 from yumingfei/migration_enhancements

Libvirt.tests: Migration tests' enhancements