qemu: Add new test tracing_exception_injection

This patch adds a new test that verifies whether the
host allows tracing of exception injection in KVM.

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
qemu.tests: Measure RHEL guest boot up time

Measure the boot up time of RHEL guest when it run level is 1.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Acked-by: Golita Yue<gyue@redhat.com>

get_image_filename have been moved to virt_storage.
And we have moved image related script to virt_storage.

Changes from v2:
Delete duplicated module
Changes from v1:
Import missing kvm_storage in live_snapshot_chain.py

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

All image related functions is moved to storage class. Update it
in boot_time.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>

backup image before boot_time test and restore image after it.

Delete image snapshot part code and simplify the code.

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

Update method for set and resotre run level. Also drop cache before
test the boot time.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
virttest.qemu_vm: Remove default value for get_monitors_by_type()

Default value None is misleading, remove it.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virt: New xml_utils.create_by_xpath() method + test

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Descendent creation by accessors

This allows using an XML accessor factory to create
an entire chain of element descendents if they don't
exist.  i.e. A disused property need not require
specific, or any XML to be in place.

Added unittest to also serve as an example for how this
can be used.

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: libvirt_xml docstring update/fix

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: libvirt_xml module @staticmethod fix

All @staticmethods on LibvirtXMLBase subclasses must
accept and pass a virsh_instance parameter, but many
were not.

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Resolve libvirt_xml numa tune TODO

Simplify access to numa parameters by making it
into a propery to return attributes as a dict.

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: fix virsh_numatune test bug

Test was failing when start_vm was "no" but gest was running.
Test was failing when requested numaset greater than available
on host.  Test was failing when --config parameter was used
but guest was not restarted.  Many thanks to Yang Dongsheng
<yangds.fnst@cn.fujitsu.com> for his help finding and helping
fix some of these problems.

Signed-off-by: Chris Evich <cevich@redhat.com>
Merge pull request #452 from cevich/create_by_xpath

Create by xpath enhancement and virsh_numatine test fixups
fix typo in libvirt/tests/cfg/virsh_attach_detach_disk.cfg

1. del a space end of line.
2. dos2unix.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
Remove the new line at the end of file virsh_edit.cfg and virsh_save.cfg.

(1). remove the new line at the end of virsh_edit.cfg.
(2). remove the new line at the end of virsh_save.cfg.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
libvirt-tests: rebuild the struct of dir libvirt/tests.

Make a dir struct for libvirt-tests. Referring to "virsh help",
the virsh_cmd module contains 11 parts. The outline looks
like:

libvirt/tests/                              virsh_cmd/
            |---cfg/                            |---domain/
                |---kernel_panic.cfg            |---monitor/
                |---remove_guest.cfg            |---host/
                |---virsh_cmd/                  |---interface/
            |---src/                            |---filter/
                |---kernel_panic.py             |---network/
                |---remove_guest.py             |---nodedev/
                |---virsh_cmd/                  |---secret/
                                                |---snapshot/
                                                |---pool/
                                                |---volume/

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
virt-libvirt: Move newer tests into virsh_cmd structure

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: virsh_destroy bugfix

Signed-off-by: Chris Evich <cevich@redhat.com>
virt: Make datadir filter messages DEBUG

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: virsh_setmem bugfix

Signed-off-by: Chris Evich <cevich@redhat.com>
Merge pull request #400 into next
qemu: make virtual_nic_sendbuffer test support windows guests

This patch make virtual_nic_sendbuffer test support windows guest.

For Windows guests:

1. Download udt.sdk.4.8.win32.zip.
   link: http://sourceforge.net/projects/udt/files/udt/4.8/udt.sdk.4.8.win32.zip
2. Unzip it, and put the file in your guest disk or cdrom.
3. Make sure the program can run normally in your guest.

Linux guest:
    make the udt_url is a valid git repo

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
qemu.tests:add sub case add max CPUs for cpu hotplug

hotplug 159 vcpus and check vcpu number inside and reboot guest

Changelog from V3:
1) removed open/close session code.
2) use vm.monitor.send_args_cmd to auto choose monitor
3) use utils_misc.wait_for() to replace time.sleep()
Changelog from V2:
1) add all error.context with logging.info
Changelog from V1:
1) fixed the hardcode log
2) make the error.context with 'logging.info' argument
3) update the docstring
4) add try / except to the hotplug code
5) sync the log with test steps
6) added 10 Secs sleep time as Win guest needs it

Signed-off-by: Xiaoqing Wei <xwei@redhat.com>
Acked-by: Feng Yang <fyang@redhat.com>

Merge the old scripts into cpu_hotplug

And cpu hotplug may support in qemu 1.5, so remove the manually
set cpu online inside guest related code.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>