libvirt: Fix a bug in virsh_change_media test and modify format

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
qemu.tests: enhance base_copy modules

New property self.events to contain block job events; And simplify
reboot function;

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: fix bug in get_image_file()

update regrex to avoid get incorrect image file when images has
backing file;

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: enhanced drive_mirror module

update drive_mirror module to make script works more stable;

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: update mirroring with reboot test

update tests steps to make it more reasonable;

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: enhance drive mirror with stress test

update stress app install steps

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: update powerup with target image step

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: refactor block mirror test with exist framework

The test add by commit 4436fb03c30317597848a7ea7e87577b90582aa9 and it
only support human monitors commands; This commit split sub-test in
this commit into two case and refactor it with exist test framework to
make it support both QMP monitor and  windows guest;

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: update drive_mirror test cfg

Update drive_mirror test configuration to make it stablly

changes from v1:
    fix some coding style issue

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: add steps to install stress app if not installed

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: move snapshot image to image dir

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: update block copy test configuration

Update configuration to make test works stably

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: update config filter some qemu images case

use "no raw qed vmdk" instead "only qcow2" because new image format (eg. qcow3)
maybe support in futuer;

Signed-off-by: Xu Tian <xutian@redhat.com>
virttest:new interface to clear a kind of events

We need to clear a kind of event only before send a monitor command, and
jude the command go into effect by check event; This interface used to
clear this kinds of events in events list;

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: fix incorrect test steps in qemu_img.rebase test

qemu-img rebase function used to changes backing_file and backing_file
format for an image file;
In this case, we create snapshots "base->sn1->sn2", then rebase sn2's backing_file
to base, then bootup with sn2 and check sn2's backing_file is base;

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: correct configuration for qemu_img tests

image rebase only support by qcow2 and qed image format; commit is used
to commit connect to image's backingfile;And boot from converted qed format
image is not support RHEL qemu;

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: remove duplicated function in block_copy module

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: refactor block_stream test with exist framework

changes from v1:
    use utils_misc.get_qemu_img_binary() to get qemu-img binary path
    instead re.search() with re.findall()

Signed-off-by: Xu Tian <xutian@redhat.com>
virttest: enhanced block_stream/drive_mirror related interface

since drive_mirror feature still in development, and key commands and options
still in changes, so do below enhancement to make script works more
stablly:

1). make key commands configurable
2). read supportted options from help info before used it;

Signed-off-by: Xu Tian <xutian@redhat.com>
virttest: auto correct command before send

Auto correct command before send it to monitor, it enable for block copy
related commands. It will helpful to compatible testing different distro
with human monitor;

Signed-off-by: Xu Tian <xutian@redhat.com>