virsh.schedinfo_qemu_posix: update the way we get the cgroup path

Now we have a new way how to obtain the correct cgroup path for
specific cgroup controller for a guest.

Let's use the new way also for the "schedinfo_qemu_posix" test.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
staging.utils_cgroup: change the regexp for finding correct cgroup path

The current approach will not properly find the path for "cpu"
controller. I've updated the regexp to match the correct "cpu".

In the "get_cgroup_mountpoint" we are searching the system
cgroup mountpoint from "/proc/mounts" where there could be right
now two types of mounts:

    cgroup on /sys/fs/cgroup/cpuset type cgroup (...)
    cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (...)

The second one makes thinks a little bit harder and we have to check
if the path ends with comma or space.

In the "resolve_task_cgroup_path" the situation is similar. We are
searching the exact path of specified controller for some guest
and there are also two types of records:

    4:cpuacct,cpu:/machine/guest.libvirt-qemu/emulator
    3:cpuset:/machine/guest.libvirt-qemu/emulator

There are thins even harder then the previous case. We need to get
only the 3th part of the record with the path. For the "cpuacct"
we have to consume also the "cpu" and that's why I'm using lookahead
in the regexp instead of the simple match to be able consume always
the remaining controller part until the colon.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
qemu.test: add pktgen stress test

This patch add pktgen stress test for nic test

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
qemu.test: add netperf stress test

This patch add netperf stress test for nic test

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
qemu.test: add file copy stress test

This patch add file_copy stress test, you can run multi sessions copy
during test.

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
qemu.test: add multi queues number change test

This patch add change queues number test for multi queues nic.
also support change queues number test under stress.

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
qemu.test :add max queues test for mq

Add test config for multi queues max queues

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
qemu.test: Modify multi queues tests

This patch rewrite multi queues tests, run netperf using netperf_stress
as a sub tests. using utils_netperf run netperf.

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
virsh_snapshot_create_as: Adjustments from review

A review comment/suggestion from @liyangfnst after pull request #1174
was merged to master was to make the entire test use try/finally type
logic so as to only run the xml_recover from one place...

This change implements that concept.
virsh_snapshot_edit: Resolve test errors

Test was failing because the 're.search()' wasn't stripping off the
newline character from the after_xml, thus not allowing the match check
to determine if the <description> changed. Changed the error processing
to list the 15 or so relevant lines from the snapshot dump xml that
could be different if the re.search() fails.

Remove the extraneous .strip() from the after_xml creation since it's
repeated in the snap_xml_compare() method when doing the comparison
with the pre_xml. Also changed the logic on error path to just print
some different lines rather than printing both whole pre/after xml
and forcing an eyeball comparison for why the test failed.
Fix a wrong logical judgment in get_target_id()

  * Wrong using 'elif' instead of 'if', then it will never judge if this target using
    the emulated image name.
  * Delete the duplicated judgment when cleanup.

Signed-off-by: Yanbing Du <ydu@redhat.com>
libirt: Add test for virsh find-storage-pool-sources-as

Signed-off-by: Yanbing Du <ydu@redhat.com>
qemu.tests.migration: Don't close remote sessions

As the pre processing code already takes care of that
anyway.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
qemu.tests.migration: Shut down VM if killing migration bg cmd times out

Sometimes, post migration run, we can run into a condition
where tcpdump or the VM hangs at migration cleanup stage.
After analyzing test logs, including VM logs, there's nothing
that points out to any guest OS crash or similar condition.

With that in mind, it is admissible to be more lenient
when trying to kill the migration background command, and
if a timeout happens when trying to kill it, be safe and
try to shut down the vm gracefully.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
qemu.tests.migrate: Adjust tcpdump kill command to be harsher

Use SIGKILL instead of SIGTERM (the default for pkill)
when terminating the background process. This way we're
less likely to run into a situation where killing the
tcpdump command times out.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.storage: Remove image to be backed up before copying the source

On an attempt to eliminate sources of disk corruption
and errors, delete the dst file if the src file is
avaliable.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #1120 from humanux/mq_change_qnum

Mq change qnum
Merge pull request #1122 from will-Do/find_pool_source_as

Add test for virsh find-storage-pool-sources-as and bug fix
Merge pull request #1166 from Antique/utils-cgroup

staging.utils_cgroup: change the regexp for finding correct cgroup path
Merge pull request #1216 from autotest/restore-image

Make the test runner more stable with 'safe' options