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>
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
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>
qemu.tests: add cpu_hotplug.nonexist_vcpu case

Hotplug one nonexistent cpus number

Signed-off-by: Xiaoqing Wei <xwei@redhat.com>