libvirt.tests: Add unsafe option test for virsh.migrate.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virsh_start: Fix pause bug in cleanup.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
virsh_start: add cases for more options.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
virsh.volume: Fix test issues

Resolve multiple issues with the test:

 1. Calling utlv.define_pool() without a 4th parameter (cleanup_env)
    results in failure since 4th parameter is expected
 2. The local 'get_image_info' should be replaced by the virt-test
    virttest/utils_misc/get_image_info().  Doing so changes the name
    of the 'img_info' field 'capacity' to 'vsize'. Since this field
    is already an 'int' bytes value - the code in norm_capacity() to
    "read" the bytes value is no longer necessary and a straight
    assignment is possible.
 3. Various 'actual_info' dictionary key's were mis-capitalized.
libvirt.test: Fix a bug in setvcpus

In test, such fail will show up:
local variable 'status_error' referenced before assignment

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
guestfish_block_dev: Add sfdisk, sfdisk-l, sfdiskM, sfdisk-N
guestfish_block_dev: Add sfdisk-disk-geometry,sfdisk-kernel-geometry
Add APIs: cat checksum checksum-device checksums-out equal
pep8 fix
Add new file guestfish_lvm.cfg and guestfish_lvm.py for test lvm
related APIs
fix a issue that can not sfdisk for lvm
Revert "virsh.domdisplay: Only add port if nonzero for vnc"

This reverts commit 9cba9b688c72181af5574cfbc4512f17db77ec13.

This patch is wrong as it was a libvirt bug. We should be careful
about adapting tests to actual libvirt behavior as the libvirt could
be wrong, not the test itself.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
tp-libvirt: Fix libvirt network bandwidth

* The portgroup attribute is only applicable with virtual network
  interface, So skip the test if the default interface is not a
  'network' type.

Signed-off-by: Hao Liu <hliu@redhat.com>
blockresize: Add more options for test

Adjust the cfg matrix to add the 'qed' disk type as well as an option
for using 'kb' and 'kib' as the scale/type of the value provided. The
virsh command will accept k, kib, and kb. Set the initial disk to
500K so that the resize will actually attempt something.  Using 1M
as an initial size and then using values that are the same for 'b', 'k',
and 'm' doesn't do anything.

Modify the test code to handle the new options and be able to account
for the lack of the fix for bz1002813 which results in an error when
'1000kb' is provided since 1000kb is not evenly divisible by 512 as
is required by qemu.  The libvirt code supplied for the bz will resize
the value to be aligned on 512 byte boundaries - so our test test will
need to account for that too.

As a side note the existing math to change values from the cfg
supplied value to an 'expected_value' made an assumption that
the value was 1024M to start with.
snapshot_edit

Fix issue when/if the snapshot_create_as() fails the 'snapshot_oldlist'
wouldn't be generated resulting in a failure during the finally: segment
and not cleaning up after ourselves fully.
tp-libvirt: Fix libvirt_pci_passthrough

* Fixed a bug when no storage device name matches target name, it can't
  properly raise an exception

* Alway SKIP the test when the target node devices are not found, else
  the tests will FAIL if the default `ENTER.YOUR...` are not changed.

* When testing storage passthrough, alway check whether its parent node
  device is a PCI device. It might be `scsi` as well, and will get an
  unexpected behaviour.

Signed-off-by: Hao Liu <hliu@redhat.com>
Merge pull request #165 from Hao-Liu/fix_bandwidth

tp-libvirt: Fix libvirt network bandwidth
Merge pull request #169 from Hao-Liu/fix_pci_passthrough

tp-libvirt: Fix libvirt_pci_passthrough
Merge pull request #117 from yangdongsheng/virsh_start_opt

virsh_start: fix and enhancement. add options --console --autodestroy --force-boot
Merge pull request #166 from jferlan/snapshot_edit

snapshot_edit: finally path broken if snapshot_oldlist not defined