virsh.attach_device: Skip login if vm is not alive

For the case where the vm is not alive, then skip doing the login() call
since there are multiple timeouts in play. One in particular - the call
to wait_for_get_address() has a 300 second timeout. If we fall into that
timeout, we can wait for up to 6 minutes per test run. When there's 16
devices that adds up to 96 minutes of waiting for no good reason.

Signed-off-by: John Ferlan <jferlan@redhat.com>
schedinfo_qemu_posix: Add cases change schedinfo by xml

This patch changed cputune info in domain xml and then restart the
domain to validate it with cgroup observation. This is a regression
test base on a known bug.

Also the emulatorpin test is changed to fit new vm_xml.

Signed-off-by: Hao Liu <hliu@redhat.com>
Merge pull request #81 from Hao-Liu/fix_schedinfo

schedinfo_qemu_posix: Add cases change schedinfo by xml
guestfish_block_dev: Add two cases for test API

1. blockdev-rereadpt
2. canonical-device-name
guestfish_block_dev: Add three cases for test API

1. device-index
2. list-devices
3. disk-format
guestfish_block_dev: Add three cases to test API

1. max-disks
2. nr-devices
3. list-partitions
guestfish_block_dev: Add two cases to test API

1. disk-has-backing-file
2. disk-virtual-size
Merge pull request #107 from jferlan/attach_device

virsh.attach_device: Skip login if vm is not alive
Add file_dir APIs: chmod, chown, lchown, du, file
Optimize checking logic for API:file
Adjust coding formats
pep8 fix
Merge pull request #119 from shi2wei3/file_dir_APIs

Add file_dir APIs: chmod, chown, lchown, du, file
Merge pull request #118 from vanbogithub/bfan-dev

guestfish_block_dev: Add total 10 cases to test APIs
domiftune: Adjust max value

Turns out this test made an assumption that the value being passed to
libvirt for the 'domiftune' as the maximum was in bytes per second rather
than the libvirt expected kilobytes per second.

The reality is, libvirt's documentation wasn't very clear so that has
been fixed. Furthermore, there was a bug in the /sbin/tc code which was
fixed that resulted in libvirt actually failing (correctly) when such a
large and incorrect value was passed. For details read the upstream commit:

http://www.redhat.com/archives/libvir-list/2014-February/msg00904.html

NOTE:
It's now not even possible to get the "maximum" bytes per second passed,
but we can come close (within 295 bytes) by passing a kilobytes value.

Signed-off-by: John Ferlan <jferlan@redhat.com>
domiftune: Update test to handle clearing inbound/outbound

In libvirt 1.2.3, commit id '14973382' it will now be possible to pass
a zero (0) as an inbound or outbound parameter to domiftune in order to
clear all the settings found.

Thus, modify the cfg to move the setting of input/output to zero from
negative to positive testing.  Also set a marker that will allow the
test code to handle the attempted clear.

Since previously 0 was considered an error, the code was modified to
check the libvirt version and handle the results based upon the version.
Prior to libvirt 1.2.3, a zero in a positive test would cause a failure,
but since it's known that way just adjust the expected results.

For the new code, we'll set the variables average, peak, and burst to
values and then pass the zero along to ensure that each of the values
was cleared on the next check.  This is only done of course if we are
at libvirt 1.2.3 or later.

NOTE:
I tested the results for the "now" good case. I also built a libvirt prior
to the specific commit id and tested that if a zero was passed, then the
code would follow the path of the expected failure. As part of this same
build - I also tested the error path if the new code changes or fails
to clear the other fields, then emit a failure.

Signed-off-by: John Ferlan <jferlan@redhat.com>