virttest/qemu_monitor.py: Allow '=' in parameter string for HMP

Parse code of monitor command parameters did not handle '='
signs in parameter itself i.e.:
cert-subject="C=CZ/L=BRNO/O=SPICE/CN=server".
This is already implemeted for QMP.

Signed-off-by: Marian Krcmarik <mkrcmari@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>
virttest.qemu_monitor: ignore empty args in qmp's send_args_cmd()

We will meet following error:

QMPCmdError: QMP command 'system_powerdown' failed    (arguments: {'': ''},
   error message: {u'data': {u'name': u''}, u'class': u'InvalidParameter',
 u'desc': u"Invalid parameter ''"})

Signed-off-by: Feng Yang <fyang@redhat.com>
run: Add --run-dropin option

Add a run option that executes scripts on a directory
called dropin sequentially in the host, rather than
the guest. The option to run the mentioned tests in
the host will be added on a future series.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Add dropin test wrapper

virt test wrapper that actually runs the dropin script.

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

Directory that holds the dropin tests.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virsh_dumpxml: Need to populate output

Commit id '7bdea150' removed the setting of output in the try/except
to call virsh.dumpxml, resulting in the error:

UnboundLocalError: local variable 'output' referenced before assignment.

This change just sets output from the cmd_result
virsh_emulatorpin: Fix syntax error

Commit id '80a1cd7b2' called cgconfig_restart()(), this resulted in
a python syntax error:

TypeError: 'bool' object is not callable

Just removed the extraneous ().
qemu.tests.multi_nic_stress: Make netperf link more configurable.

Current code always try to get netperf from shared/deps.

This patch make it more configurable. We can set multi netperf links,
web link, absolute path, relative path.

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.tests.netperf_udp: Make netperf link more configurable.

Current code always try to get netperf from link, but network may
not accessible in some pc.
As disscussed we can put netperf in shared/deps folder.

This patch make it more configurable. We can set multi netperf links,
web link, absolute path, relative path.

Signed-off-by: Feng Yang <fyang@redhat.com>
shared.deps: Add netperf tarball

Since it is necessary by default by the netperf test.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virsh_vcpupin: use libvirt submodule for call

Commit id 'b94ccb677' missed the libvirt submodule reorganiation
for the 'cpu_allowed_list_by_task()' call resulting in the error:

AttributeError: 'module' object has no attribute 'cpu_allowed_list_by_task'
Merge pull request #1005 from jferlan/virsh_emulatorpin

virsh_emulatorpin: Fix syntax error