qemu.tests.qmp_command: Update the way to get qemu_binary.

After some updating, current code could not get correct qemu binary.
So Case error with message "TestNAError: Host qemu does not support qmp".

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.tests.pci_hotplug: Make device_add_nic and device_add_block have same parameters

Add a useless parameter in device_add_block().

These two function called by following code:
        try:
            # get function for adding device.
            add_fuction = local_functions["%s_%s" % (cmd_type, pci_type)]
        except Exception:
            raise error.TestError("No function for adding '%s' dev with '%s'" %
                                  (pci_type, cmd_type))
        after_add = None
        if add_fuction:
            # Do add pci device.
            after_add = add_fuction(pci_num, queues)

So they must have same parameters.
Now we meet error:
TypeError: device_add_block() takes exactly 1 argument (2 given)

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.tests: correct test step

for this test we need to compare images when vm is in paused status;

Signed-off-by: Xu Tian <xutian@redhat.com>
Merge pull request #1065 from FengYang/update5

Fix for next branch - Update5
Merge pull request #1066 from xutian/drive_mirroring_fix

qemu.tests: correct test step
virttest: Add parameter to control log level.

Initial effort to add the parameter "--log-level" when running tests,
to control the log level. For example:

./run -t qemu --log-level=error

Will only log ERROR messages.

Note that The default value remains DEBUG level.
Currently it only applies to log/debug.log.

Signed-off-by: Ruda Moura <rmoura@redhat.com>
virttest: Test option '--log-level' through a list of fixed values.

Test possible values for option '--log-level' based on a list of fixed
log level names (stored in SUPPORTED_LOG_LEVELS).

Signed-off-by: Ruda Moura <rmoura@redhat.com>
qemu.tests: Use qemu-kvm -M ? to get machine type for physical resource check

The old method to get expect machine type can not fit machine type check for
q35 and pc. So update it by get the machine type string from the output
of qemu-kvm -M ?.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
virttest: Update khugepaged test timeout

As the khugepaged process will quit slowly in some OS, enlarge the
timeout for khugepaged test from 5s to 50s. And also use the method that
check process status in a while loop which will break when the khugepaged
process status is changed as expect instead of time.sleep(timeout).

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Add snapshot-edit command in virsh.py

1. Add snapshot-edit, snapshot-parent command
2. Modify snapshot-current to output xml/name or command output

Signed-off-by: Kyla Zhang <weizhan@redhat.com>
Change the function place for common use and add options for sync

1. change the function place and improve implementation
2. Add option for sync

Signed-off-by: Kyla Zhang <weizhan@redhat.com>
Add config file for snapshot-edit test

Signed-off-by: Kyla Zhang <weizhan@redhat.com>
add snapshot-edit test

Signed-off-by: Kyla Zhang <weizhan@redhat.com>
virttest.utils_test: Add libguestfs module.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
libguestfs.tests: Move shared classes and functions to utils_test.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virt-libvirt: Removed trailing whitespace

Signed-off-by: Chris Evich <cevich@redhat.com>
virttest: Record the output from QMP monitor when failed to get the greeting message

Record the json output from QMP monitor when we raise the MonitorProtocolError. It
may help us to analyse what failed this step.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
netperf: fix a typo

We compute rpkt_per_exit by tx_pkts, and compute tpkt_per_exit
by rx_pkts. It's wrong.

Signed-off-by: Amos Kong <akong@redhat.com>
Merge pull request #1079 from kongove/for-lmr

Fix a typo in netperf result
virttest.libvirt_xml.pool_xml: Fix py 2.4 incompatible construct

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