virt: fix problem of checking persistent in virsh.net_state_dict().

When network is transient, net_autostart() will raise.
The next step will try to get "transient" in result_object.
While error messages may not be in stderr but exist in result
object indeed:

 * Command:
 net-autostart default --disable
 Exit status: 1
 Duration: 0
 stdout:
 error: failed to unmark network default as autostarted
 error: Requested operation is not valid: cannot set autostart
        for transient network

Message "transient" exists, but stderr is None.
So search "ranient" in whole result object will be more suitable.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virt-libvirt: Add test module for virsh net-define|undefine.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
qemu.tests.qemu_guest_agent: Install dependent DLL files with script

The previous patches for adding windows support of qemu-guest-agent
depend on a guest image in which user has installed necessary DLL
files.

This patch tries to install these DLLs by test script, so that to
we can test this feature with a fresh windows system.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests.cfg: Fix the config of qemu guest agent test

The previous patch introduced a bug in the qemu-ga.exe path.
This patch tries to fix this problem.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests: Add heavy disk write load test for windows guests

Add heavy disk write load test for windows guests. Using Crystal
Disk Mark [1] to generate the write load inside the guest. And set the
default cache to writeback in this test.

changes from v1:
  - Record steps in INFO logs
  - Close the session after test
  - Add command empty check

[1] Crystal Disk Mark is a BSD licensed program
    http://crystalmark.info/software/CrystalDiskMark/manual-en/License.html

    It can be downloaded here:
    http://crystalmark.info/software/CrystalDiskMark/index-e.html

    The file will be added to the winutils.iso

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Acked-by: Feng Yang <fyang@redhat.com>
qemu: Add test qemu_nobody test

This test checks groups when guest is started as
nobody [v2] using qemu -runas option to exec the qemu.

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
virttest/qemu_vm:Fix unable to add nodefaults qemu command line

has_option(help_text, "use_nodefaults") will always return false because
qemu help_text just has 'nodefaults' line, instead of 'use_nodefaults'.
So -nodefaults will never be used as qemu command line.

This patch is to avoid this error situation

Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
Merge pull request #280 from yumingfei/virsh_net_define_undefine

virt-libvirt: Virsh net define undefine pull request #280
qemu.enospc:update the test.bindir to data_dir.get_data_dir

Now use test.bindir will not find the image file, just update it
to new interface data_dir.get_data_dir

Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
Merge pull request #444 from QiuMike/qemu.enospc_update_the_test.bindir_to_data_dir.get_data_dir

qemu.enospc:update the test.bindir to data_dir.get_data_dir
Merge pull request #435 from QiuMike/virttest_qemu_vm_Fix_unable_to_add_nodefaults_qemu_command_line

virttest/qemu_vm:Fix unable to add nodefaults qemu command line
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

Signed-off-by: Chris Evich <cevich@redhat.com>