xenapi: Speeding up the easy cases of test_xenapi

These were the tests that only required changing the base class. The remaining
tests in test_xenapi will need to have their stubs modified to not hit the DB.

nosetests nova/tests/virt/xenapi/test_xenapi.py

BEFORE: Ran 201 tests in 25.957s
AFTER: Ran 201 tests in 24.573s

Change-Id: Ia0478ac81f1b2b316a22b15e3171250d3b839073
migrate server doesn't raise correct exception

Currently a BadRequest is raised for the migrate and live-migrate API
operations when the given instance isn't found. This patch changes the
APIs to raise a InstanceNotFound instead to be consistent with the other
admin action APIs which hit the same type of error.

Closes-Bug: #1239038

Change-Id: I28cd367c5885481ea19ace43855b2518a2afd955
nova.exception does not have a ProcessExecutionError

Looks like a refactoring problem. utils.execute throws
processutils.ProcessExecutionError

Change-Id: Ia1e2f4761f555fa834826000e91bb3592e3eea7f
make libvirt driver get_connection thread-safe

libvirt driver's get_connection is not thread safe in the
presence of a libvirtd restart during concurrent incoming
requests.

With existing code each will in turn call get_connection,
find the connection is broken, try to create new one, block
for a while and yield to the next thread to do the same.
You get as many connections as there are incoming requests
and only the last one is used finally. If enough are incoming
these connections can exhaust the client pool configured
for libvirtd.
One fix is to hold a lock while creating the connection.
Note that has_min_version calls _conn which calls get_connection
and thus the direct call to _has_min_version()

Also added the exception text if it fails to register an event
handler for lifecycle events.

Change-Id: I090765802bfe443440f16722bc7c43b6280fe56a
Fixes: bug #1240905
Add tests for compute (child) cell

When testing the compute API, we should also be testing when the
cell_type is 'compute'.

Change-Id: Ib0a82e00040eed5814ed7a031070b343d32ee2db
Fix migrate w/ cells

While in a child cell, do not raise when the current flavor is passed
into compute API's resize().  This is behavior that should be limited to
nova-api.

Closes-bug: 1243816

Change-Id: Ie67af3ab3003164e9742a8c4d5bd75502dca96c4
Merge "Add tests for compute (child) cell"
Merge "Fix migrate w/ cells"
Merge "nova.exception does not have a ProcessExecutionError"
Merge "make libvirt driver get_connection thread-safe"
Merge "xenapi: Speeding up the easy cases of test_xenapi"
Merge "migrate server doesn't raise correct exception"