virsh: update dumpxml to return CmdResult object

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libvirt: adapt calling of virsh.dumpxml to new @return of CmdResult object.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
virsh_capabilities: Find the qemu-kvm in os PATH

Rather than assume qemu-kvm is found in /usr/libexec use the utils_misc.
find_command method to locate "qemu-kvm". If not found, then raise an error
Merge pull request #959 from jferlan/virsh_capabilities

virsh_capabilities: Find the qemu-kvm in os PATH
virt-libvirt: New libvirt_xml accessor generators

* Small behavior fix on XMLElementText
* XMLElementBool: Treat "flag" elements as boolean values for presense
* XMLElementNest: Allows "nesting" an arbitrary LibvirtXMLBase subclass
                  then rerooting it's XML under a parent element
* XMLElementList: Represent duplicate child elements (valid in XML) as
                  if it were a list, with values marshaled to/from XML
                  and opaque values.
* Added unittests for all three

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Remove disused VM methods

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Fixup some unittest whitespace

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Implement libvirt_xml.devices.disk

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Rename address device property

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: XMLAttribute accessor behavior fix

All other "get" accessors raise xcepts.LibvirtXMLNotFoundError when
their data doesn't exist.  If this returns None, then caller may
mistake the value as None, when there is no value.

Signed-off-by: Chris Evich <cevich@redhat.com>
virt: Fix broken restore() functionality

* The backup/restore logic inherrited by xml_utils.XMLTreeFile
  is backwards from the perspective of a caller.
* xml_utils.XMLTreeFile must re-parse the tree after restoring
  from the backup.
* Provide restore() convenience method so test code doesn't
  need to access xmltreefile attribute directly.

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Don't take screenshots of dead VMs

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Fix short login timeout before reboot

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Implement libvirt_xml.devices.disk

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: attach/detach device test

This is a kind of sub-framework for performing both virsh-command operational
and VM-functional testing with arbitrary collections of devices.  Types, numbers
and parameters for devices can be class-specific or generic.  All testing for
each device is specified by overriding an abstract base class.  The main
test code then facilitates creation/destruction of lists of device class
instances, and gathering results.

Signed-off-by: Chris Evich <cevich@redhat.com>
libvirt-bench: Add test for domstate switch in unixbench.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libvirt_vm: Add dump method to VM

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Add test to run dump when unixbench is running in guest.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
utils_test: Add a param copy_only into utils_test.run_autotest.

Add a copy_only param in run_autotest, whose default value is False.
If copy_only is True, run_autotest will not run test on guest and
return the command to caller.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
utils_test.run_autotest: Add a '--exclude=client/tests/virt/*' in tar command.

When we call run_autotest() function to run a test on guest, if the size of
autotest is too large, test will fail to execute tar command. Sometimes the
reason of huge size is size of virt, virt/shared/images, virt/shared/iso.

As run_autotest function is designed to run tests in autotest/client/tests
out of virt, we need not copy the virt subsystem in to guest.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>