Use osapi_compute worker for api v2 service

osapi_compute is intended to be a superset of the compute APIs (v1
through v3 and beyond). So use the worker settings for osapi_compute
when launching any service that starts with 'openstack_compute_api' that
might be defined in paste.ini and in enabled_apis. While this could
result in the single setting causing nX workers, where n is each
openstack_compute_api_* thing defined, it is expected that only one is
enabled, or the full superset is enabled.

Change-Id: Ic1bb69c8675f2ffb71cdf8a4b38ba7b02e697458
Use constant for microversions header name (cleanup)

Define and use a constant for the microversion header
name rather than repeat the string literal in multiple places.

Partially implements blueprint api-microversions

Change-Id: Ief296211d5cff8b3ccfc8231cb2336582bd47ef1
objects: add method to verify requested hugepages

Introduces a new method can_fit_hugepages to numa cell object

Work-Item: Enhance libvirt driver to configure guests based on
           the flavour parameter for page sizes

Partial-Implement: blueprint virt-driver-large-pages
Change-Id: I600840a96b13c1de4f2f409069f452e18e1c1c52
hardware: determine whether a pagesize request is acceptable

Enhances numa_fit_isintance_cell to return whether the cell host
can handle the page size request

Work-Item: Enhance libvirt driver to configure guests based on
           the flavour parameter for page sizes

Partial-Implement: blueprint virt-driver-large-pages
Change-Id: Ib8546c2a22017f738f644b94dcf00f4afd3582fc
libvirt: introduce a fixture for mocking out libvirt connections

The various libvirt test suites all have different ways of mocking
out libvirt connections. Some use fakelibvirt, others create their
own lame re-implementation of fakelibvirt, others mock random
methods. To improve sanity, introduce a standard fixture to be used
by all libvirt tests for mocking libvirt. This will ensure that the
libvirt.openAuth method always returns an instance of fakelibvirt
virConnect object. This should allow for a number of the fakelibvirt
reimplementations to be eliminated eventually.

Blueprint: libvirt-driver-class-refactor
Change-Id: I2a61dba5a273455d6b3c15e9cae0f3bff7f641fa
libvirt: convert test_host.py to use FakeLibvirtFixture

Instead of monkey patching the Host class to use fakelibvirt,
just use the FakeLibvirtFixture. Also create an instance of
the Host class in setUp since every test case needs it.

Blueprint: libvirt-driver-class-refactor
Change-Id: I1d737fc22bc26b686790c06362eb7c61b26bd39d
libvirt: sanitize use of mocking in test_host.py

Tidy up the test_host.py test suite, so that it uses mock
exclusively instead of stubs. Also annotate test methods
in preference to using nested contexts since it leads to
clearer test methods.

Blueprint: libvirt-driver-class-refactor
Change-Id: Idc536e408b22cadf8b12ec2bd4ed978f1110fd83
libvirt: remove unused get_connection parameter from VIF driver

Previously the VIF driver would have to take different action
for OpenVSwitch depending on the libvirt version. Since we
bumped the min libvirt version this is no longer required, so
the get_connection parameter to the VIF driver is unused.

Blueprint: libvirt-driver-class-refactor
Change-Id: I1925a433a00f5ea3b65899ecb64d904045519340
Fix recent regression filling in flavor extra_specs

In commit cb338cb7692e12cc94515f1f09008d0e328c1505, we dropped an extra
DB query to fill in flavor extra_specs because the object should already
have those set. However, if we pulled the flavor from the instance,
extra_specs are mostly not stored, which means we effectively cut off
the scheduler filters from access to those things.

This adds that back in for that case, but only temporarily. Soon we will
be merging a change to stash real flavor objects with the instance, which
will make this moot. However, that may take a while to merge and this is
broken now.

Change-Id: Ia728025345b09687da9744004f0f47ad73ce196c
Closes-Bug: #1403547
Merge "objects: add method to verify requested hugepages"
Merge "hardware: determine whether a pagesize request is acceptable"
Merge "Fix recent regression filling in flavor extra_specs"
Merge "libvirt: introduce a fixture for mocking out libvirt connections"
Merge "libvirt: convert test_host.py to use FakeLibvirtFixture"
Merge "libvirt: sanitize use of mocking in test_host.py"
Merge "libvirt: remove unused get_connection parameter from VIF driver"
extract RPC setup into a fixture

This extracts the common RPC setup into a fixture. Eventually we need
to get this fixture off the base setup as < 5% of tests actually use
the RPC infrastructure today (probably more than half of those are
using it by accident due to insufficient mocking), and only 3 cells
tests actually need the exmods setting.

This moves the ball forward slightly towards getting there.

part of bp:functional-tests-for-nova

Change-Id: I7ab9f7f0615c137025aa07e4113e0d207d36a4c5
Merge "Use osapi_compute worker for api v2 service"
Merge "Use constant for microversions header name (cleanup)"
Merge "extract RPC setup into a fixture"