use file instead of tap for non-blockdevice images on Xen

In nova/virt/libvirt/utils.py the method pick_disk_driver_name() returns
"tap" for non-blockdevices on Xen. This leads to an exception on the
xend service. The returned driver name should be "file" instead of
"tap".

fixes bug 1084618

Change-Id: Ib87f18f56afb3c5f34c30e9aea605dad24a36cdf
Add generic customization hooks via decorator.

Hooks add the ability to insert custom code around operations that
declare a named hook:

e.g.

@hooks.add_hooks('create_instance')
def create_instance(....):
   ....

The above hook allows Hook objects to be run 'pre' and 'post' the
execution of create_instance()

Hook objects are discovered via the setuptools entry point group
'nova.hooks'.

Change-Id: I3961df12ef415085de7459438967edacc34500c2
Fix handling of unimplemented host actions

Fixes bug #1060884

Host actions like enable/disable, maintenance mode and power management
are not implemented in most virt drivers.

In the case of set_host_enabled() in the libvirt driver, we have a no-op
implementation. In other cases we have an implementation which raises
NotImplementedError. Since the default implementation is to do this, we
should just remove the redundant methods from the drivers which don't
actually implement these actions. This ensures NotImplementedError is
consistently raised.

On the API side, rather than looking at the return value of these
methods to determine whether they're implemented, we should just catch
NotImplementedError and return a sensible error message.

In order to do this, we need to ensure the NotImplementedError is
properly deserialized from the RemoteError which will encapsualte
it. The fix for bug #1086798 ensures this happens.

Finally, add some tests to make sure we properly respond with 501
when the virt driver doesn't implement these actions.

Change-Id: I2d4fc51a4b16d5230e61bde75915142ea450557d
Fix fname concurrency tests.

It was possible for thread2 to run before thread1 in the fname
concurrency tests. When this happens the assertions in the fname
concurrency tests fail. In each fname test block until thread 1 signals
the test before creating thread 2. In the different fname test block
until thread 2 signals the test before beginning the actual test work.

This ensures everyone has started as expected before checking the
expected done values.

Part of blueprint grizzly-testtools

Change-Id: I119fb03423324c9db9847b97d9bb69e71fef2aad
Use fixtures library for nova test fixtures.

Moving the test-case setup and teardown code into managed fixtures
so that we can better interact with them when we start running things
in parallel.

Part of blueprint grizzly-testtools

Change-Id: I406be0a88b14c0dba2d22b4957e26a53442bbae3
Added sample tests to FlavorManage API.

Partially implements blueprint nova-api-samples
Fixes bug 1070163

Change-Id: Ib838adf0c21f3eee6c52cd8e1942c96ae89cca98
Unpin lxml requirements

Ubuntu is using a much newer version of lxml so
we shouldn't lock the versions in our infrasctructure.

Change-Id: I688c0be196db526f220262e25afa79d84fcae632
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Raise NotImplementedError in dns_driver.DNSDriver.

Updates dns_driver.DNSDriver so that we raise NotImplementedError
instead of returning empty result sets or passing. Since this
class is the default dns_driver for Nova it can be quite
confusing when it returns empty results (which actually
causes some HTTP 500 errors as well).

We really need to switch the default floating/instance
dns managers to MiniDNS as smoketests fail otherwise we
currently use nova.network.dns_driver.DNSDriver which is
not correct

Fixes LP Bug #1040236
Fixes LP Bug #1027998

Change-Id: Id818bb00e0689d96db948872842c07d2cf1edd57
libvirt: enable apic setting for Xen or KVM guest.

Bug 1086352

Currently, nova doesn't enable apic setting for Xen or KVM guest
in its libvirt driver. Windows guests would not boot successful in
such case. This patch adds apic setting in libvirt driver for Xen
or KVM guest, which would fix this problem. A check is also added
to libvirt guest config test case for this patch.

Change-Id: Ie213c9d086f77faf0cdc5a32337c5bf4b828cf5f
Use conductor for bw_usage operations

This patch moves bw_usage operations from compute manager
to conductor. In an effort to reduce the number of API points
we're adding to the conductor RPC API, this patch actually
only adds an update function, which also returns the current
values. This is used by the public conductor API layer to provide
both get and update calls through a single remote function.
Discussion and comments on this approach are welcomed.

Related to blueprint no-db-compute

Change-Id: Iabe4cef2bccc8ffcf0ddc76bf7b328c2c4d87112
Access DB values as dict not as attributes. Part 4

We cannot assume nova.db.api will be returning sqlalchemy objects
attributes, instead treat return values as dicts

Part of blueprint db-api-cleanup

Change-Id: Ie98c2cad080d95edcfa89b2601f6c57cb1188cbc
Merge "Added sample tests to FlavorManage API."
Merge "Raise NotImplementedError in dns_driver.DNSDriver."
Merge "Access DB values as dict not as attributes. Part 4"
Merge "libvirt: enable apic setting for Xen or KVM guest."
Merge "Add generic customization hooks via decorator."
Merge "Unpin lxml requirements"
Merge "Fix fname concurrency tests."
Merge "Use fixtures library for nova test fixtures."
Merge "Use conductor for bw_usage operations"