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>
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