Merge pull request #11 from lmr/0-14

avocado: Fix setup.py to use version 0.14.0
avocado.virt.qemu.machine: Start QEMU process after init

Due to the changes in the avocado.process.SubProcess() class,
now the SubProcess object has to be started after it is
initialized. Let's reflect that in the Machine() class.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.virt.qemu.machine: Add screendump() method to the Machine() class

Add a screendump method, that will prompt the qemu instance
to dump the VM screen at a path specified by the parameter
filename. This will be necessary to implement a screendump
thread that will go on while a VM is active.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.virt.qemu.machine: Add logdir param to Machine() constructor

We need a base log directory for output on each VM instance,
so we can output things like VM screendumps to the proper
log directories inside the avocado directory structure.

Add a logdir param to the Machine() class, that will be
assigned to the attribute logdir upon construction.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.virt.qemu.machine: Generalize .short_id parameter

The shorter version of the id will be necessary in other
locations. Therefore, make it part of the class structure.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Add avocado.virt.utils namespace

To add the utility functions of the virt testing code.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Add image library to the avocado.virt.utils namespace

Add an image library, that will be used to put utility
classes and functions related to image format manipulation.
That sort of functions come up when handling VM screenshots,
usually.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.virt.qemu.machine: Add screendump thread to VMs

Create a screendump thread on every VM. This is a departure
from previous efforts (virt-test), where the thread was
under control of an extraneous part of the code.

So at the QEMU process init stage, start the thread, when
the VM is shut down, stop it. This way, we have images
of what was going on in the VM during the test process.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.virt.test: Use '-vga std' as the default for QEMU processes

That will allow videos of the VMs to be actually generated,
as 'vga -none' will not output any video.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.virt.qemu.machine: Add uuid as a Machine() constructor param

Migration is a process by which VM state is transferred
to another instance of the virtualization system transparently,
and with virtually no downtime. This motivated us to model
the .migrate() method of the Machine() class preserving the
instantiated object (for all intents and purposes, it is
the 'same' virtual machine).

Therefore, it makes sense to have videos of a vm being migrated
as a single entity. Make uuid as one of the Machine class
constructor params, so that we have the option of making
migrated vms to keep the same uuid, and have them to behave
as a single entity for the purposes of vm video generation.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.virt.qemu.devices: Add .add_nodefaults() method

Include a method to add the '-nodefaults' flag to the
QEMU command line.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.virt.qemu.devices: Add .add_vnc() to Machine() class

Add a utility method .add_vnc() to the Machine() class,
used to append '-vnc :[port]' into the QEMU command line.

This patch also adds a port management system inside the
Devices() class, meaning that we will not use a port that
is either allocated or occupied.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.virt.qemu.machine: Move migration port management to Devices

We're still a long way from a sane port management, but
this patch improves on the current status quo. By moving
the assignment of the -incoming tcp port to the Devices
class, management becomes uniform, more fool proof and
elegant.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>