Set vm state error when raising unexpected exception in live migrate

The instance stuck at migrating task_state when unexpected exception.
This is confuse for user, this patch set the vm_state to error.

Change-Id: Ib1b97452bc5e777c66c4d368f71156dbe1e116b7
Partial-Bug: 1397153
Adds hacking check for api_version decorator

Because of the implementation of this decorator and the controller's metaclass,
the api_version decorator must be the outermost (ie first) decorator wherever
it is used. This patch adds a hacking check to ensure that this is the case.

This decorator is intended to be used on multiple methods with the same name
which offends F811, so '#noqa' is needed too. This will be fixed in a separate
patch.

Bad:
    @some_decorator # noqa  <-- '# noqa' to avoid F811
    @api_version("2.5")     <-- Error, needs to be the first decorator
    def my_api_method...

Good:
    @api_version("2.5") # noqa   <-- this line still needs '# noqa' for F811
    @some_decorator
    def my_api_method...

Change-Id: I579c0061f03d788c477c5424d4d00ec7a6e721e1
Remove unused db.api.fixed_ip_get_by_address_detailed

Change-Id: I23ccad0460f38db5314180fda865153bd8784c01
libvirt: Fixes live migration for volume backed instances

Live migration fails for volume backed instances in LibvirtDriver
because _is_shared_block_storage() incorrectly identifies volume
backed disks as local. This is fixed by passing the block_device_info
parameter to get_instance_disk_info, which allows for correct
filtering of volume backed disks.

Change-Id: I1437b2a7d5a62615b0099114ed1b5b1110f56de2
Closes-bug: 1392773
Doc: minor fixes to unit testing devref

The unit testing devref had a bit of inconsistent formatting, and a reference
to HACKING.rst which could have been linkifed.  This patch fixes both of those,
and additionally the examples have been updated to reflect the recent split
into functional and unit tests.

Change-Id: I15129808d0d1271c1223e7ab8d8532f8cb2f7293
extract fixtures from nova.test to nova.test.fixtures

Start extracting all the setup code in note.test into fixtures which
will let us decompose test setup (and have test base classes that
don't setup everything).

This creates new OutputStreamCapture fixture and StandardLogging
fixture and unit tests for both of them plus tests for the exiting
Conf fixture.

H305/306 have to be turned off because hacking import rules are broken
and continue to believe that fixtures is a nova module not the
absolute one.

Change-Id: I97fdacdf5a6ad2957b0efa1e21ae084d4eb04ab9
move ServiceFixture and TranslationFixture

Move these into the new namespace. No additional testing added at this
point.

Change-Id: I0a45dab39745591a55ffc91b31aed8df5179767a
move all conf overrides to conf_fixture

Some config overrides were in conf_fixture, and some were living in
test.py:setUp. If we are globally overriding conf variables we should
do it in one place, the fixture.

Change-Id: Ief66e2245179a37eae60bafaf9e8f452d89319a7
Clarify point of setting dirname in load_standard_extensions

Changing dirname to alter how os.walk visits directories is a little
known feature, so add a note inline explaining how it works.

This came up because someone filed a bug saying this block of code was
confusing.

Closes-Bug: #1399546
Change-Id: I4cab323fcc7a4e2aab2ca7c36d6b9505b6a05bcb
Merge "Doc: minor fixes to unit testing devref"
Merge "Adds hacking check for api_version decorator"
Merge "Clarify point of setting dirname in load_standard_extensions"
Merge "extract fixtures from nova.test to nova.test.fixtures"
Merge "move ServiceFixture and TranslationFixture"
Merge "move all conf overrides to conf_fixture"
extract the timeout setup as a fixture

Includes tests for the nova specific parts of this.

Change-Id: I591f3c270804dfb01eab7c8c5d43b87a7abcdeda
Merge "Set vm state error when raising unexpected exception in live migrate"
Merge "libvirt: Fixes live migration for volume backed instances"
Merge "Remove unused db.api.fixed_ip_get_by_address_detailed"
Merge "extract the timeout setup as a fixture"