Prepend '/dev/' to supplied dev names in the API

Make sure that all user input device names end up in the database with
the '/dev/' prefix. This will make things more consistent and avoid
issues when attempting to parse device names.

This includes two main sources - block device mapping that can be passed
as part of a request or as image metadata, and root device name, passed
as image metadata.

Closes-bug: #1337821
Change-Id: Ibda82f511be99f1a68f2f77c72601a1b006be7a0
Adjust audit logs to avoid negative mem/cpu info

we might have following audit info in the log:
AUDIT nova.compute.resource_tracker [-] Free ram (MB): -1559
AUDIT nova.compute.resource_tracker [-] Free disk (GB): 29
AUDIT nova.compute.resource_tracker [-] Free VCPUS: -3

which is really confusing to operater and useless
This patch adjust the log to print phy info and virtual cpus.

DocImpact

Change-Id: I2bc63e1aae0787bf976660eed8fd8899bfffe593
Closes-Bug: #1316916
Add unit tests to cells conductor link

Adding unit tests to verify ConductorTaskRPCAPIRedirect
and compute/api.py are properly hooked.  If they become out
of alignment then calls can be potentially ignored.  We can't
blindly error in the case of ignoring as this is used
legitimately in other cases.

Change-Id: Iec02d4a5906a5851c1e9c8258a2d77f908ec65bc
Partial-Bug: 1348642
DB: use assertIsNotNone for unit test

Commit 48de2895b9a550a0944b31212349275605a4061d added a
validation that should have used assertIsNotNone.

TrivialFix

Change-Id: Ib6b82d90bb163f7ee06c916e52d3dd40ff2ba34d
Enhance PCI whitelist

While keeping the existing PCI passthrough functionality intact, this patch
makes the following enhancements:

* allows aggregated declaration of PCI devices by using '*' and '.'
* allows tags to be associated with PCI devices.

A whitelist entry is defined as:
["device_id": "<id>",] ["product_id": "<id>",]
["address": "[[[[<domain>]:]<bus>]:][<slot>][.[<function>]]" |
"devname": "Ethernet Interface Name",]
"physical_network":"name string of the physical network"

<id> can be a '*' or a valid device/product id as displayed by the linux
utility lspci. The address uses the same syntax as it's in lspci. Refer to
lspci's manual for its description about the '-s' switch. The devname can be
a valid PCI device name. The only device names that are supported in this
specification are those that are displayed by the linux utility ifconfig -a
and correspond to either a PF or a VF on a vNIC. There may be 0 or more tags
associated with an entry.

If the device defined by the address or devname corresponds to a SR-IOV PF,
all the VFs under the PF will match the entry.
For SR-IOV networking, a pre-defined tag "physical_network" is used to define
the physical network that the devices are attached to.

Multiple whitelist entries per host are supported as they already are. The
fields device_id, product_id, and address or devname will be matched
against PCI devices that are returned as a result of querying libvirt.

Change-Id: I96e3e0174fa79ef9dd0ffbec172ba1c0420a37f8
Partially Implements: blueprint pci-passthrough-sriov
Merge "Prepend '/dev/' to supplied dev names in the API"
Merge "Enhance PCI whitelist"
docs - Fix docstring issues in virt tree

Fix the following errors in several files.

ERROR: Unexpected indentation.
ERROR: Unknown interpreted text role "paramref".
WARNING: Block quote ends without a blank line; unexpected unindent.
WARNING: Definition list ends without a blank line; unexpected unindent.
WARNING: Enumerated list ends without a blank line; unexpected unindent.
WARNING: Field list ends without a blank line; unexpected unindent.

Specifically the "Unknown interpreted text role" was fixed by adding
a separate import instead of importing 'text' directly. Others were
indentation, new lines, or adding lists.

Change-Id: I241ce1ca9831d9df00d022297ea622953a6fdc60
docs - Fix exception in docs generation

We need to pass the flavor_id when creating the side_effect
using FlavorNotFound exception

Change-Id: Id5d0ac387d2dca2dc70dabba173fc53972751236
Closes-Bug: #1351127
docs - Fix errors,warnings from document generation

SEVERE: Unexpected section title.
ERROR: Unexpected indentation.
WARNING: Block quote ends without a blank line; unexpected unindent.
WARNING: Definition list ends without a blank line; unexpected unindent.
WARNING: Field list ends without a blank line; unexpected unindent.
WARNING: Inline emphasis start-string without end-string.
WARNING: Inline interpreted text or phrase reference start-string without end-string.
WARNING: Inline strong start-string without end-string.

Partial-Bug: #1351350

Change-Id: I661e0e32519f8e4de3325efd10242824015ed03d
Merge "Add unit tests to cells conductor link"
Merge "docs - Fix docstring issues in virt tree"
Merge "docs - Fix exception in docs generation"
Merge "docs - Fix errors,warnings from document generation"
Merge "Adjust audit logs to avoid negative mem/cpu info"
Merge "DB: use assertIsNotNone for unit test"