Adding ability to specify the libvirt cache mode for disk devices

In past versions of Nova it was possible to explicitly configure
the cache mode of disks via the libvirt XML template. The current approach
makes this a derived setting of either “none” or “writethrough” based
on the support of O_DIRECT. Whilst this provides a good set of default
settings it removes the ability of the cloud provider to use other
modes such as “writeback” and “unsafe” which are valuable in certain
configurations.

This change allows the cache mode to be specified on a per-disk type
basis. If a disk type does not have a cache mode specified then the
default behaviour remains unchanged.

DocImpact

bug 1086386

Change-Id: I3d296fe0b4b9b976db02db90ad69fd299cd2096a
Add module prefix to exception types

Change-Id: If1b0eccc9c75553fdbb3280ab742b1f4d6ea7861
Removes unnecessary qemu-img dependency on powervm driver

Fixes bug 1131033

Power VM driver is using qemu-img through the fetch_to_raw call
No need to attempt a conversion since power images can only
be represented with the raw format, removing thus the need for
any conversions by calling fetch instead of fetch_to_raw.

Change-Id: I94b46e184cb87924a4754a0a48d9c2013a3eb756
Don't set filter name if we use Noop driver

If we are using the Noop firewall driver we don't set a filter name.

Fixes: bug #1131358
Change-Id: I5e8a92baa6838ed51b55ffd6af1e98da6dd662c2
Make LibvirtDriver.uri() a staticmethod.

LibvirtDriver's uri() function seems to be the most logical place
where one can access the libvirt URL used by Nova. I would like
access to this outside the scope of the internal libvirt
driver (for libguestfs) so exposing it as a static
resource seems to make sense.

Partial fix for LP Bug #1131768.

Change-Id: I653296414716b4e799d68f6bfc868e6039d6ea4a
Make guestfs use same libvirt URI as Nova.

Updates our libguestfs vfs implementation so that it makes use of
the same libvirt connection URI as Nova does when using
attach mode 'libvirt'. Previously when libguestfs used attach
mode 'libvirt' (the default on some newer distros like Fedora 18)
you could get permissions issues and ultimately get a libvirt
connection error from libguestfs:

  could not connect to libvirt (URI = NULL)

Docs on guestfs attach method can be found here:

  http://libguestfs.org/guestfs.3.html#attach-method

Having libguestfs use the same connection URL as Nova makes sense
and gets past these permission issues. (avoiding things like forcing
you to create a $HOME dir for the nova user among other things)

Full thread on this is here:

  https://bugzilla.redhat.com/show_bug.cgi?id=913345

Note that on most distros the default libguestfs attach method
is still 'appliance' so this would have no affect unless explicitly
enabled via LIBGUESTFS_ATTACH_METHOD.

Fixes LP Bug #1131768.

Change-Id: I7e9f010022731a43e8d793cf8415ec12b346fdb4
Fix exception handling in baremetal API.

In patch ab9f8667c63d901f37d1662c5204fb2938be44fe, several
baremetal/db/api methods' exceptions were changed from InstanceNotFound
to NodeNotFound. The API extension for baremetal was not updated to
catch these, and this was not caught by unit testing. This resulted in
unhandled exceptions within nova-api if any baremetal node lacked an
associated interface.

While fixing that bug, a few other unit tests for the baremetal API
were added, and a missing exception was added to db/api bm_node_destroy.

Fixes bug 1131430.

Change-Id: I15f7624723754f9d7b217b609663a2d709acb056
Remove compat cfg wrapper

This wrapper was there to allow oslo-config changes through the gate
while keystoneclient hadn't been updated.

Change-Id: I3d48673af58ae379e8e4d2c7fb4b4d81f3ed67dd
Updates to OSAPI sizelimit middleware.

Updates the OSAPI sizelimit middleware so that we use avoid calling
len on a request body which could cause a really large request
to get buffered into memory.

Also updates the middleware to return HTTP 413 which is a more
correct error code in this case (previously it returned just 400).

Fixes LP Bug #1131857.

Change-Id: Id8bc5eeb0fba9482809edd12543a75163e1227e9
Add processutils from oslo.

RPC now depends on processutils.
Fixes bug 1131872.

Change-Id: I2c24f70aa37e56c2d12df370386629c76d89e4be
Add missing import_opt for flat_injected

Fixes bug 1131891

Change-Id: I993798abea27b8d37efe5d3c122a490d85e192a8
libvirt: lxml behavior breaks version check.

lxml doesn't roundtrip empty strings, meaning if you serialize
and element with value '', when you derserialize it, the value will be
`None`.

This broke the version_string_with_package check because None and ''
will not compare as equivalent.

The solution is to coerce the None value back to an empty string before
running the check.

Change-Id: Ia3a8ae68f12a4645057d243fdee59197df40e8d3
Prevent default security group deletion.

This patch adds a check to confirm that a security group name
is not among a list of 'special' group names before proceeding
with security group deletion.

Fixes: bug 1131830

Change-Id: I5656e01b4ed3fd9c22abe6a731edaef7203d97c4
Remove Print Statement

Removing a rogue print statement that I missed
in a previous commit

Change-Id: I472944d90937d8b6484f3ec419cdd5083db533c5
Ensure macs can be serialized.

This patch uses to_primitive() to ensure that the macs argument to the
rpcapi method allocate_for_instance() can be serialized by rpc drivers.
Specifically, the powervm driver uses a set() here, and that will cause
breakage in non-kombu drivers.

Fix bug 1131035.

Change-Id: I5729c5854799e49c6598e4dd2a4da487598307f1
Merge "Fix exception handling in baremetal API."
Merge "Remove compat cfg wrapper"
Merge "Add module prefix to exception types"
Imported Translations from Transifex

Change-Id: I20f746956c6bd829973478fa3ef5174df2a8596a
Merge "Don't set filter name if we use Noop driver"