Fixed check in image cache unit test

Before the fix assert checked nothing bacause .sort() sorts
provided list and has no return. Comparison of two None objects
is always true.

Change-Id: I3d453a29b5913cd24ce8d9e4a2324c7ad8d138b7
Add V3 api for pci support

All pci passthrough code is merged into nova, but the APIs are not supported.
This patch provides a resource: endpoint to show PCI information. This is a
part of PCI APIs, for more information see the blueprint.

Partially implement blueprint pci-api-support

Change-Id: I05c502cb7564b8b71f12d8f06249124b3d2b370f
VMware: raise more specific exceptions

In certain cases the exception handling for backend errors
would be handled too broadly. This patch elevates the backend exception
to the application so that it can treat specific errors.

In the application we can now handle the following specific exceptions:
 - FileAlreadyExists - for example when moving a directory to a directory
                       that already exists
 - InvalidProperty - for example when using neutron and opaque networks
                     are not supported
 - AlreadyExists - for example a port group already exists
 - NotAuthenticated - for example the operation is denied as because a
                      session is not established

Related-Bug: #1266579
Related-Bug: #1266580
Closes-bug: #1276539

Co-authored-by: Matthew Booth <mbooth@redhat.com>
Change-Id: I0873f570d97345208c8d9b5bcbb5a980a7a58f9d
VMware: prevent race for vmdk deletion

Prevent a race condition for the deletion of a file when there
is more than one process trying to erase the file.

In the application we can now handle the following specific exceptions:
 - CannotDeleteFile - the file cannot be deleted
 - FileFault - a file access exception
 - FileLocked - an attempt is made to lock a file that is
                already in use
 - FileNotFound - the specific file does not exist

Change-Id: I58e07b9e630c063f894cbbb138612a39e912acd5
Closes-bug: #1266580
Remove XML support from schemas v3

The XML support was removed from the V3 API plugins,
this part of the code was not used again.

Partially implements blueprint remove-v3-xml-api

Change-Id: I7bc3ed2386d8d678eb13ac4592e4cce2ba8a1602
VMware: factor out management of controller keys and unit numbers

This patch encapsulates the allocation of controller key and unit
number for a new virtual disk/CDROM into utility function.
This way high-level methods like spawn, rescue, etc. don't have
to deal with implementation details like the above and the
algorithm for allocating controller_key and unit_number is
clearly defined and can be easily reused.

Change-Id: Ia6d5db5d5c5fa25f680eae82892dcb9b2be864fa
Closes-Bug: #1259981
Refactor driver BDM attach() to cover all uses

Add separate flags to allow the execution to skip the
volume_api.check_attach step, and to be able to call the
driver.attach_volume if needed. This will make the method modular enough
to be used in all cases where we actually "attach" volumes to instances.

Check attach should always be done in the API, followed immediately by a
reservation, to minimize the chance of a race. However currently we
do the check_attach step on the compute side during boot, so it needs to
stay. Other operations like attach_volume will have it reserved causing
this check to fail on the compute side, so we lay down the groundwork to
be able to skip it when calling attach().

Likewise, when booting, we don't need to call the virt driver
attach_volume method, as all the devices will be taken care of by the
boot code path.

Part of blueprint: use-new-bdm-format-in-attach

Change-Id: Iff3890e39a8c75b1693df0918084ecf4492c4e91
Merge "VMware: factor out management of controller keys and unit numbers"
Merge "VMware: raise more specific exceptions"
Merge "VMware: prevent race for vmdk deletion"
Merge "Remove XML support from schemas v3"
Merge "Add V3 api for pci support"
Fixed spelling errors in nova

Change-Id: I2d9fc7278c96bcd9f7d50a1af6db6df56df28111
Merge "Refactor driver BDM attach() to cover all uses"
Merge "Fixed check in image cache unit test"
Merge "Fixed spelling errors in nova"