Cleanup and test volume usage on volume detach

* Refactor _poll_volume_usage to be more readable

* Test that detaching a volume updates the totals on the volume usage
  cache correctly. This works but adding test to make sure that it always
  works.

Change-Id: I82da44137bc65d5f04bca0820eb327438d6e1f35
Delete extra space to api/volumes message

Change-Id: I04efa9c8ddb5790f99d66c302198bf92000f6e66
Signed-off-by: You Ji <jiyou09@gmail.com>
Fix hyperv copy file error logged incorrect

This patch just fix hyperv copy file error message
incorrect, missing src and dest value.

Fixes bug #1170580

Change-Id: I309fd67b3f491c9be872ff9cdd58f6364a26a96b
Stop vm_state reset on reboot of rescued vm

When a VM is in rescue mode, giving it a reboot will reset its state in
the DB back to ACTIVE.

This patch stops that happening.

Work towards bug: 1170237
Change-Id: Ie442bcc85ed7ad5d897b88ffd0dbcf6eeee7b990
Adds tests to xenapi.vm_utils's 'lookup' method

Change-Id: I140f091b50c3e4076d3f4812cae00e37f120a277
Allows xenapi 'lookup' to look for rescue mode VMs

When you lookup a VM by name, you can specify if you want it to check if
it has a rescue mode instance running.

If it finds the rescue mode instance, it'll return that one instead
of the original name.

This is useful for operations that should work on the rescue mode vm if
it's there, or the normal one, if it's not.

Work towards bug: 1170237
Change-Id: I41b31e59631b78a62faadb9970b6b824929e7061
Can now reboot rescued instances in xenapi

This patch makes it possible to reboot an instance that is in rescue mode.

It causes the reboot action to search first for rescue mode VM (the
normal VMs name plus '-rescue') .. if it can't find it, it does a reboot
of the normal VM. If it finds the rescue one first, it'll reboot the
rescue instance.

If there is more than one VM named 'myvm-rescue', it'll raise an
exception just like it did if there were more than one VM named 'myvm'.

Helps with bug: 1170237

Change-Id: I1858d86bf93546618eeaaec92d856f5236f3f090
Merge "Delete extra space to api/volumes message"
Merge "Cleanup and test volume usage on volume detach"
Merge "Stop vm_state reset on reboot of rescued vm"
Merge "Adds tests to xenapi.vm_utils's 'lookup' method"
Merge "Allows xenapi 'lookup' to look for rescue mode VMs"
Merge "Can now reboot rescued instances in xenapi"
Merge "Fix hyperv copy file error logged incorrect"