qemu.test: add reboot step for pci_hotplug testing

We need step reboot guest after hotplug/unplug pci device to verify guest
not crash or hang when reboot;

Signed-off-by: Xu Tian <xutian@redhat.com>
dump-guest-memory QMP command: check vmcore correctness

Before upstream qemu commit

  commit 56c4bfb3f07f3107894c00281276aea4f5e8834d
  Author: Laszlo Ersek <lersek@redhat.com>
  Date:   Tue Aug 6 12:37:11 2013 +0200

      dump: rebase from host-private RAMBlock offsets to guest-physical
      addresses

the dump-guest-memory QMP command used to write incorrect vmcores for
x86_64 guests with more than 3.5GB RAM. Add a testcase that creates a 4GB
guest, dumps its core, copies it into the guest, and analyzes it there
with the "crash" utility.

Related RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=981582
Related RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=990118

Suggested-by: Ademar de Souza Reis Jr. <areis@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Merge pull request #842 from xutian/add_reboot_step

qemu.test: add reboot step for pci_hotplug testing
virttest.qemu_vm: Remove media=floppy

media accepts only disk or cdrom. Use media='' to ignore it even in
strict_mode. (strict_mode sets media=disk when media is None)

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_vm: Ignore image_format for floppies

image_format is usually set for images. Floppies usually use raw so
we'd have to either set image format for floppies or we can simply
ignore it (this solution).

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_devices: Fix floppies handling on old qemu

Old qemu without -global support must use -drive index=n
to set the floppy slot.

Signed-off-by: Lukáš Doktor <ldoktor@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>
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.qemu_vm: modify nic hotplug fd

In autotest python get the fd by os.open("dev/net/tun"),
then using getfd pass the fd to the qemu process. some
times the fd number qemu get is not same as parent's fd.
will call nic hotplug error, this patch fix this issue.

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>

Conflicts:
	virttest/qemu_vm.py