virt.qemu: Fix changes in redirs wasn't mirrored to devices.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt.qemu: Adds windows timedrift not ntp-sync tests.

Check timedrift with suspend, hibernate, stop_continue tests.

Makes Windows be able to suspend or hibernate it is necessary
have installed all drivers and selected gpu with suspend
and hibernation support. (tested with qxl and WinXP)

Signed-off-by: Jiří Župka <jzupka@redhat.com>
Merge pull request #965 from waynesun09/virsh_vcpucount

libvirt: virsh vcpucount test
virttest.virsh: Add virsh nodecpumap command

Add nodecpumap command and fixed two functions' params description

Signed-off-by: Wayne Sun <gsun@redhat.com>
libvirt: Add virsh nodecpumap command test

Signed-off-by: Wayne Sun <gsun@redhat.com>
libvirt: virsh_vcpucount: Change to virsh.vcpucount

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Updating rv_build_install.py to be more efficient

Signed-off-by: Swapna Krishnan (skrishna@redhat.com)
Merge pull request #971 from xutian/update_storage_migrate_cfg

qemu.tests: update block mirroring/streaming cfg
virttest: Add functions to remove color codes from Linux console output

Sometimes Linux console output include some escape and sequences
for display. This make the console output hard to read and analyse.
This function will help scripts to remove those special codes.

Also add a function for get the stripped output from sessions on
aexpect.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
qemu.tests: Fix the wrong list_nic_addr

Current version make up a wrong list_nic_addr.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
qemu.tests: Use get_stripped_output to read from serial console

Use  get_stripped_output to remove the unreadable codes
from the serial console output.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
qemu.tests: Make boot order check fit for qmp monitor

The output from qmp monitor for pci information is different from
human monitor. This help the scripts run correctly with both qmp
and human monitor.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
qemu.cfg.ksm_base.disable: Update extra_params for rhel host.

rhel host do not support extra_params += " -machine mem-merge=off".
Change to extra_params += " -redhat-disable-KSM"

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.tests.cfg.cdrom_test: Disable pre_cmd and post_cmd for RHEL3, 4, 5, 6 guest

There is no /usr/lib/udev/rules.d in these guest.

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.tests.migration_with_dst_problem: Correct the way check whether disk list is empty

We should use if disk to check whether disk list is empty

Or this script will fail with following error:
Traceback (most recent call last):
  File "/home/autotest/client/shared/test.py", line 426, in _exec
    _call_test_function(self.execute, *p_args, **p_dargs)
  File "/home/autotest/client/shared/test.py", line 853, in _call_test_function
    raise error.UnhandledTestFail(e)
UnhandledTestFail: Unhandled IndexError: list index out of range    [context: (run_migration_with_dst_problem)]
Traceback (most recent call last):
  File "/home/autotest/client/shared/test.py", line 846, in _call_test_function
    return func(*args, **dargs)
  File "/home/autotest/client/shared/test.py", line 299, in execute
    postprocess_profiled_run, args, dargs)
  File "/home/autotest/client/shared/test.py", line 216, in _call_run_once
    *args, **dargs)
  File "/home/autotest/client/shared/test.py", line 322, in run_once_profiling
    self.run_once(*args, **dargs)
  File "/home/autotest/client/tests/virt/virt.py", line 136, in run_once
    run_func(self, params, env)
  File "/home/autotest/client/shared/error.py", line 138, in new_fn
    return fn(*args, **kwargs)
  File "/home/autotest/client/tests/virt/qemu/tests/migration_with_dst_problem.py", line 639, in run_migration_with_dst_problem
    tests_group()
  File "/home/autotest/client/tests/virt/qemu/tests/migration_with_dst_problem.py", line 53, in __new__
    ret = self.test(*args, **kargs)
  File "/home/autotest/client/tests/virt/qemu/tests/migration_with_dst_problem.py", line 436, in test
    self.workload()
  File "/home/autotest/client/tests/virt/qemu/tests/migration_with_dst_problem.py", line 467, in workload
    disk_path_src = find_disk_vm(self.vm_guest, self.disk_serial_src)
  File "/home/autotest/client/tests/virt/qemu/tests/migration_with_dst_problem.py", line 148, in find_disk_vm
    return os.path.join(disk_path, disk[0])
IndexError: list index out of range

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.cfg.host_kernel: Set workaround_qemu_qmp_crash to always in rhel host.

We need set workaround_qemu_qmp_crash to always to ignore the dump.

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.cfg.host_kernel: Disable rdma related migrate case in RHEL host.

rdma related migrate case are not supported in rhel host. So disable them.

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.tests.pci_hotplug: Add default value for queues parameter

This patch have us fix "TypeError: int() argument must be a string or a number,
not 'NoneType'" error when queues parameter not set in config.

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest.staging.utils_cgroup: Remove '\t' from the string in get_property()

When call get_property() we may get following error n cgroup test:
Description of problem:
Traceback (most recent call last):
  File "/home/autotest/client/shared/test.py", line 426, in _exec
    _call_test_function(self.execute, *p_args, **p_dargs)
  File "/home/autotest/client/shared/test.py", line 846, in _call_test_function
    return func(*args, **dargs)
  File "/home/autotest/client/shared/test.py", line 299, in execute
    postprocess_profiled_run, args, dargs)
  File "/home/autotest/client/shared/test.py", line 216, in _call_run_once
    *args, **dargs)
  File "/home/autotest/client/shared/test.py", line 322, in run_once_profiling
    self.run_once(*args, **dargs)
  File "/home/autotest/client/tests/virt/virt.py", line 136, in run_once
    run_func(self, params, env)
  File "/home/autotest/client/shared/error.py", line 138, in new_fn
    return fn(*args, **kwargs)
  File "/home/autotest/client/tests/virt/qemu/tests/cgroup.py", line 2032, in run_cgroup
    return fce()
  File "/home/autotest/client/shared/error.py", line 138, in new_fn
    return fn(*args, **kwargs)
  File "/home/autotest/client/tests/virt/qemu/tests/cgroup.py", line 366, in blkio_throttle
    return blkio_throttle_multi([[_] for _ in speeds])
  File "/home/autotest/client/shared/error.py", line 138, in new_fn
    return fn(*args, **kwargs)
  File "/home/autotest/client/tests/virt/qemu/tests/cgroup.py", line 537, in blkio_throttle_multi
    % (dev[0], dev[1], speed))
  File "/home/autotest/client/tests/virt/virttest/staging/utils_cgroup.py", line 411, in set_property
    % (repr(check), repr(_values)))
TestError: cg.set_property(): Setting failed: desired = '8:16 1024', real values = ['8:16\t1024']
    [context: Executing test: blkio_throttle --> Init --> Setup test]

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest.cartesian_config: Make 'replace deprecated template with eval in cart-config' works for multi deprecated template

        - rebase:
            type = qemu_disk_img_rebase
            rebase_mode = safe
            base_format = qcow2
            guest_file_name_image1 = "${tmp_dir}/base"
            image_chain += " snA snB"
            image_name_snA = "images/snA"
            image_name_snB = "images/snB"
            guest_file_name_snA = "${tmp_dir}/snA"
            guest_file_name_snB = "${tmp_dir}/snB"
            variants:
                - snB:
                    check_files = "${tmp_dir}/base ${tmp_dir}/snA ${tmp_dir}/snB"
                    variants:
                        - to_base:
                            rebase_list = "snB > image1"

from the log we know that only signal ${tmp_dir} is replace to /var/tmp
But check_files did not change.

Signed-off-by: Feng Yang <fyang@redhat.com>