virt test: Add qemu-io class

Add qemu-io class to provide interface for tests to execute qemu-io
command.
There are two kinds of qemu-io execute way:
  - QemuIOShellSession: Provide a shell session to execute qemu-io
    operates continuously
  - QemuIOSystem: Execute qemu-io command which will return
    immediately. Mainly for qemu-io -c, -h and -V

changes from v1:
  - typo fix
changes from v2:
  - Add function get_cmd_line to reduce the reduplicate code
  - remove useless lines
  - Use qemu_io_binary to get qemu_io from params

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
KVM test: Add qemu-io blkdebug test

This test will check if the error output from qemu-io is fit the
blkdebug.cfg. Steps as following:
    1. Create image with given parameters
    2. Write the blkdebug config file
    3. Try to do operate in image with qemu-io and get the error
       message
    4. Get the error message from perror by error number set in
       config file
    5. Compare the error message

If you want to make up your own qemu-io blkdebug test with different
error event. You can modify these parameters:
  err_event: the error event will write in blkdebug.cfg
  err_command: the command running in qemu-io which will trigger
the error event

changes from v1:
  - Use ConfigParser to generate the blkdebug.cfg file from the
changes from v2:
  - Update the interface
  - Remove the useless line and fix and make the variable name
    more clear

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
virt tests: Add test for removing guest

Running libvirt test with sample configuration create guest that stays
in system after the test. This complicate running test again. For xen is
this issue bigger complication as it does not allow to run pv and hvm test
in one run (second of them will fail as name exists).

This patch adds simple test 'remove_guest' that take care of removing guest
from system. This test is added to sample configuration of libvirt too.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
virt.kvm_vm: Fix shell_prompt regular expression not passed to "ShellSession"

if we don't pass the shell_prompt to the class "ShellSession",
it will use the default one from __init__ of "ShellSession",
if it doesn't match it, it will cause a failure.

Signed-off-by: Lei Yang <yanglei.fage@gmail.com>
virt: subtests.cfg.sample - Add "only Windows" to ntttcp testcases

So far, this testcase is designed for Windows,
so add "only Windows" in the config file to make
sure linux guest not run it.

Signed-off-by: Lei Yang <yanglei.fage@gmail.com>
virt.kvm_vm: Extend SPICE support

The past SPICE support was covering only old qemu-kvm and it's not
working any more with recent qemu

Added SPICE features (configurable qemu-kvm options):
* QXL: configurable memory for qxl
* SSL :x509-dir, x509-key-file, x509-cacert-file, x509-cert-file,
* x509-key-password, tls-port, tls-ciphers, secure-channels
* SSL: added virt_utils.create_x509_dir() which creates required
* certificates for x509 options
* Compression: image-compression, jpeg-wan-compression,
* zlib-glz-wan-compression, playback-compression
* Networking: ipv4, ipv6, addr
* Other: agent-mouse

Modified:
* QXL: replaced old way of defining number of qxl devices qxl=n ->
* -device qxl
* QXL is now being trough in kvm_vm.add_vga()
* VGA: vga = std is now defined in base.cfg.sample (removed from
* -nodefaults in kvm_vm.py)
* drop add_qxl_vga() into favor of add_vga() (+ add_qxl() in case that
* user defined qxl memory or extra qxl devices)

Signed-off-by: Lubos Kockman <lkocman@redhat.com>
virt.virt_utils: Fix create_x509_dir function

As it had several coding style inconsistencies. Also,
move it in the virt_utils file.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
ltp: Fix duplicate names in list of failed tests.

Signed-off-by: Vinson Lee <vlee@twitter.com>
autotest.base_utils: Move virt.utils.Thread to common_lib

Move the class virt.utils.Thread to base_utils.InterruptedThread thus it can be used in general utils.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
autotest.common_lib: Add syncdata class to common_lib

Syncdata class allows to synchronize data between
multiple hosts and guests. It creates a server for
syncing data and hosts uses the server for data
synchronization.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt.virt_utils: Add framework for multihost migration

Multihost migration framework makes multi host migration
guest with load easy. This patch also replaces old tests
for multihost migration with versions that use the
framework.

Multihost miration framework takes care of:
  - preparing environment before migration
  - preparing guest for migration on source and dest host
  - start guest
  - start work on guest
  - migration between hosts
  - check work on destination host
  - close guest
  - postprocess environment after migration

The framework also allow start multiple migration
independently in some time with multiple hosts and
different work on guests.

Signed-off-by: Jiří Župka <jzupka@redhat.com>