Support for multiple luns, scsiid and bus'

* add support for lun, scsi-id and card definition
* fixes minor issues in scsi-* devices addition

Signed-off-by: Lukas Doktor <ldoktor@redhat.com>
kvm test: Parametrisation of multi_disk test

This patch makes multi_disk test more flexible. You can use
stg_params variable to set all kinds of setups. As example
I added few tests for virtio_scsi disks and all_drive_format test.

stg_params is a space separated set of parameters of newly added
disks. Every parameter have to have a name and after ':'
it can be ',' separated list of words or 'range(...)'.

range() is similar to python range(), but it supports 4th argument,
which multiplies occurrence of each value:
range(0,2,1,2) => [0,0,1,1]
Also range() supports 'n' which is substituted later to fit the
number of disks. See the code for details.

Signed-off-by: Lukas Doktor <ldoktor@redhat.com>
virt.virt_env_process: verify if screenshot term event is a thread

Before trying to verify if it is set. This bug was
spotted while working on the multi_disk test.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt_utils.py: add get_ip_address_by_interface()

* returns IP Address by network interface (e.g. virbr0)
  accepts ifname which can be retrieved from base.cfg

* raises NetError in case of failure

Reason: gethostbyname(gethostname()): ip associated to my hostname
        was different than IP leased for my bridge (virbr0)

Signed-off-by: Lubos Kocman <lkocman@redhat.com>
virt: guest-os.cfg.sample - added RHEL6.3beta

* currently the only GA distro which supports up2date version
  of spice (especially virt-viewer package) is RHEL6.3 beta
  (and possiblyFedora rawhide).

* Filename + checksum matches with contents from RHN

* platform prerequisity for remote-viewer (Pull #333)

Signed-off-by: Lubos Kocman <lkocman@redhat.com>
virt: Add RHEL-6.3.ks with dependencies for SPICE testing

* @x11, @basic-desktop
* spice-vdagent, spice-xpi, remote-viewer, usbredir

Signed-off-by: Lubos Kocman <lkocman@redhat.com>
kvm_vm.py - fixes in add_spice()

This commit fixes an issue when qemu-kvm is running with
port 3000 and remote-viewer uses port generated automatically.

Until this time rv_connect was accidentally connecting to a first
free port (3000,3001) generated in add_spice(). it also changed
order in which self.spice_options is being populated, so
I'm sure it will always be done before add_spice

Also, I've removed passing of spice_options to add_spice() and
processing it as self.spice_options from within add_spice()

Signed-off-by: Lubos Kocman <lkocman@redhat.com>
virt.kvm_vm: Remove qemu cmdline debug print

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
test/kvm: add control.spice and tests-spice.cfg.sample

* add tests-spice.cfg.sample
  - which should provision two rhel6.3.beta vms (client+guest)
    and execute rv_connect

* add control.spice which parses tests-spice.cfg

Signed-off-by: Lubos Kocman <lkocman@redhat.com>
virt/base.cfg.sample: commented out all spice options

* commented out all spice related options as I'm specifying
  variants in tests-spice.cfg and this would only cause me some
  unwanted settings.

* I'd like still to have all these options present in base.cfg so it
  will be simple (uncomment) to do just boot, shutdown with SPICE

Signed-off-by: Lubos Kocman <lkocman@redhat.com>
virt/tests new test rv_connect.py

* not yet supporting windows

* does not yet support openssl as I need to figure
  out multiplatform file transfer (libguestfs I guess)

* only RHEL6.3beta+, Fedora18+ as earlier versions
  does not have remote-viewer binary inside virt-viewer

* remote-viewer/virt-viewer is currently preffered
  client for SPICE

* uses two guests for testing:
    - one which uses vnc (not spice) and is used for
      executing remote-viewer (package virt-viewer)
    - one which uses spice and is used as target for
      remote-viewer

* supports password/disabled-ticketing authentication

* this simple test basically does following thing
 1) killall Xorg
 2) start Xorg
 3) connect with remote-viewer to vm1 (with spice) by using
    specified spice_port
 4) uses netstat for checking established connection on specific
    host and port (+ check for binary name)

Signed-off-by: Lubos Kocman <lkocman@redhat.com>
virt: repair bug in multihost migration.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Allow set speed limit for scp

Signed-off-by: Jiří Župka <jzupka@redhat.com>
kvm-test: Adds multihost migtration test with file transfer.

This test starts vm on master host. When vm is started then it starts file
transfer between vm and master host:
     work:                             migration:
   host1->vm                        mig_1(host1->host2)
   vm->host1
   checksum file
   host1->vm
   vm->host1                        mig_2(host2<-host1)
   checksum file
   host1->vm
   vm->host1
   checksum file                    mig_3(host1<-host2)
       ...                                 ...
       ...                                 ...
       ...                                 ...
   host1->vm                               ...
   vm->host1                               ...
   checksum file                    mig_migrate_count(host2<-host1)

      end:
   check all checksum with orig_file checksum

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt_utils: Fix undefined references to exceptions on virt_vm

Unfortunately we will restore a circular dependency on
virt_vm, but we can't let this bug not fixed.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
tests-spice.cfg.sample: fixed typo

* ice_x509_dirice_x509_dir = yes -> spice_x509_dir = yes

Signed-off-by: Vaclav Ehrlich <vehrlich@redhat.com>