qemu.test.transfer_file_over_ipv6: some modification

Make some modification

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
Merge pull request #858 from ldoktor/framework2

virttest.qemu_devices: Fix floppy issues
virttest.aexpect: Support commands longer than 2MB

Current kernels support unlimited argument length, the only limit is
stack size. The default stack size is usually 8KB which is sufficient
for ~2MB commands. Use ulimit to increase these limits. The multi_disk
in some configurations attacks the 2MB barier and in the future we
might see this comming (unless we switch to -readconfig).

NOTE: Only superuser can increase the hard limit, anyway if the command
      fails the test continues and tries to execute the cmd anyway.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.env_process: Parallelize the image processing

Some cases create many disks, which takes a long time, where most
time consumes the handling around cmd execution. This patch parallelize
the image processing in case we deal with over 20 disks. It spawns
$no_cpus * 2 threads (or less in case it would be inefficient).

The performance improvement was significant (30=>12s on 4CPU system).

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
qemu.tests.multi_disk: Tweak the config file of virtio_scsi_variants

Use the unified configs (scsiid=>unit, lun=>port) and store the images
in the usual location. The location '/tmp/%s' was used before because
python was unable to execute that long command and this prefix shorten
it significantly. Now autotest supports the way to deal with long
commands so we can finally store the images in the right location.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
More PEP8 fixes

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.qemu_devices: Fix boot=on not being passed to RHEL5 qemu

On RHEL5, we were not passing boot=on properly to the
qemu-kvm binary. Fix the heuristics to detect whether
the binary uses this ancient syntax to define virtio
disks as bootable.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
qemu.tests.physical_resources_check: Fix RHEL5 compatibility

Turns out RHEL5 qemu does not support the 'info qtree'
command, therefore an attempt to parse the output of
this command will fail. So skip that particular check
when running on this particular qemu version.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
cfg: Update cluster_size to image_cluster_size

As the parameter name is changed in qemu_storage.py. Update the cfg file
to fit it.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Add attach_disk and dettach_disk in VM class.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
Add a method named 'sync' to VMXML class.

Lots of times to call vmxml.undefine() and vmxml.define(), to
make our config in vmxml take effect in vm.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
Add test for svirt attach disk.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
virttest.test_setup: Improve error message

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.qemu_vm: Fix coding style

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.qemu_vm: Fix error in string repr of MigrateError

The problem was that the arguments for the string interpolation
were not passed as a tuple, as they should. When hitting
an unknown migration protocol error, the return would raise
a TypeError. Let's fix it.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
physical_resources_check: Convert exceptions to strings before concatenation

There might be an occasion where we get the following
error:

TypeError: unsupported operand type(s) for +: 'MonitorProtocolError' and 'str'

So let's try to convert the exception class to a string
first.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
libvirt-tests: Add test for libvirt_bench_domstate_switch_in_loop

Test for the performance of libvirt in domain state switching.

Steps:
    * shutdown (or destroy)
    * start
    * suspend
    * resume

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
bootstrap: Create gpg directory upon data dir creation

Since a GPG file is a user provided data (like isos
and guest images), it makes more sense to have it
under shared/data/gpg than shared/gpg. So remove the
later and fix things in the bootstrap module.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.qemu_devices: Use the bus function to check if it matches the spec

When we try to match a bus to some specification (dictionary) it makes
sense to ask the bus and not to try to guess. This way we can customize
the function to each bus, if necessarily.

Additionally make it possible to ignore autotest type by setting
atest=False. This could be used to see if this specification matches from
qemu point of view, but doesn't match from autotest point of view.
(from qemu point of view ahci and ide bus is the same, but in autotest
we want to make sure the ide-hd goes into the correct HBA). This feature
will be used in the following patch.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>

Conflicts:
	virttest/qemu_devices.py
virttest.qemu_devices: Differentiate between qemu and autotest bus type

qemu doesn't differentiate between some of the buses, which are
differentiated in autotest (eg. ahci and ide disks belongs simply
to IDE bus type). In order to be able to distinguish between those
buses we need to add atype (=autotest type) of the bus.

This patch makes this change only for images, where were problems
caused by different qemu/autotest behavior. If this concept prooves
to be right, we can use it to distinguish between various kinds of
USBs in order to reflect the qemu behavior while keeping the autotest
standards.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>

Conflicts:
	virttest/qemu_devices.py