Add InstancePCIRequests object

Part of blueprint pci-passthrough-sriov

Co-Authored-By: Dan Smith <dansmith@redhat.com>
Co-Authored-By: Baodong (Robert) Li <baoli@cisco.com>
Change-Id: I125e4afdf98a7073abcb8117bbb7a3e3fe2f9830
Handle exception better in v2 attach_interface

Add more information when exception occurs in attach interface
at v2 API layer.

Change-Id: I7402cfc28d4ee7989c7eb054556df57918bbaeee
Replace pci_request flavor storage with proper object usage

This makes the PCI code use the InstancePCIRequests object to store
and retrieve the pci_request information, instead of stashing it in
system_metadata.

Related to blueprint pci-passthrough-sriov

Co-Authored-By: Baodong (Robert) Li <baoli@cisco.com>
Change-Id: I012ee5c118265e044ff41fb58b732728946ee85a
Add request_id in PciDevice

Added request_id in the PciDevice object and the corresponding
model. Migration script is added accordingly. Parent objects's
versions are bumped, and backleveling rules added.

Partially Implements: blueprint pci-passthrough-sriov
Change-Id: I2367339a29c0da8b526fd5105766e51ca4e8c6ab
Support SR-IOV networking in the PCI modules

This patch takes care of changing the PCI modules in support of SR-IOV
networking:
  -- Updated pci_whitelist to use devspec that is introduced in this
     patch: https://review.openstack.org/#/c/99043/
  -- For stats pool, to keep the existing behavior, pool keys always
     include product_id and vendor_id. Meanwhile, to work with tags
     and support pci requests based on tags, pools are ordered based
     on the number of keys of the pool. This makes sure that legacy
     pci requests will be satisfied with the pools in the beginning,
     possiblly with devices that are not tagged.

Partially Implements: blueprint pci-passthrough-sriov
Change-Id: I9da7bd921f098c958d6fb711a4d03a76862e95c7
Support SR-IOV networking in nova compute api and nova neutronv2

Add another field into the NetworkRequest object for the request_id.
For a SR-IOV port, Create a PCI request and add the pci-request-id into
the tuple. For a non SR-IOV port, the pci-request-id is None.
Add new fields 'profile' and 'vnic_type' in VIF.
Enhance nova neutronv2 api module to:
  -- retrieve a port's vnic-type and the physical network it is attached to
  -- populate binding:profile before updating a neutron port
  -- populate VIF with newly added fields.
Partially Implements: blueprint pci-passthrough-sriov
Change-Id: I4aab1cd43960d5b1b54a67a05c191f295dfc46fb
Support SR-IOV networking in libvirt

This patch takes care of changing the libvirt modules in support of SR-IOV
networking. Added full support in configuring the two VIF types:
VIF_TYPE_802QBH and VIF_TYPE_HW_VEB and in generating the corresponding
domain XML. It also adds support of attaching/detaching SR-IOV ports
on instance suspend/snapshot/resume operations.

Change-Id: Ibc47d13f47fa0b41cefc27bfff942cdbba6eb399
Implements: blueprint pci-passthrough-sriov
Adds LOG statements in multiprocess API test

Renames _terminate_workers() to _wait_for_workers_to_end() to accurately
match what is done in that method. Adds a bunch of LOG.info() and
LOG.warn() calls in the various methods in the test to get better
debugging information when bug # 1357578 rears its ugly head.

Change-Id: I6698b7c71ec651c812138c8dd93b1e1b33ee1178
Related-bug: #1357578
Merge "Adds LOG statements in multiprocess API test"
Merge "Handle exception better in v2 attach_interface"
Merge "Add InstancePCIRequests object"
Merge "Replace pci_request flavor storage with proper object usage"
Merge "Add request_id in PciDevice"
Merge "Support SR-IOV networking in the PCI modules"
Merge "Support SR-IOV networking in nova compute api and nova neutronv2"
Merge "Support SR-IOV networking in libvirt"