libvirt: use tap for non-blockdevice images on Xen

This patch reverts 35c4962c0b97bae5b8751d316d5822fe22c1ab6a: 'use
file instead of tap for non-blockdevice images on Xen', which breaks
qcow2 disk working on Xen. If the method pick_disk_driver_name()
returns 'file' for qcow2 format, we would get the following disk XML
snippet:

    <disk type="file" device="disk">
      <driver name="file" type="qcow2" cache="none"/>
      <source file="/data/instances/instance-00000081/disk"/>
      <target bus="xen" dev="hda"/>
    </disk>

which produces configuration in the xen tools like:

    "file:/data/instances/instance-00000081/disk,hda,w"

Guest would not boot successfully, as Xen doesn't think of disk format
as qcow2. Instead, 'tap' works with both raw and qcow2 disk.

For LP#1084618, I think it is related with libvirt verion. In my
deployment(libvirt-1.0.1), 'tap' dirver could produce correct
configuration for both raw and qcow2 disk format.

Change-Id: I636b2fed366474e2ae8c3b52403e3085724b24f0
Add rootwrap filters for password injection with localfs

Allow to 'sudo cat' to read passwd and shadow.

bug 1098077

Change-Id: Ic734bd33223df879b5e1f144bb4c85702eb88dfa
Fix floating ips with external gateway

If dnsmasq is configured to use an external gateway, then floating
ips on other interfaces do not work properly. This is because
outgoing traffic is no longer snatted to the floating ip.

This patch fixes it by adding an ebtables rule to force traffic
from ips that have a floating ip associated to route instead
of bridge.

Fixes bug 1096985

Change-Id: I8e4904660d42fe51c44b66686bed9f5d622693bd
Add version constraint for cinder

Cinder client usage requires the "retries" parameter introduced in
cinderclient-1.0.1. This should be a constraint in pip-requires.

Change-Id: I36e8a363c9d4bb7cc4ecfda85644fc4284f17471
_sync_compute_node should log host and nodename

ResourceTracker:_sync_compute_node logs the host name when it
creates or updates the record for a compute node. However, with
baremetal, one compute_node (host) may actually manage many
separate physical nodes, identified by unique nodenames.

This patch updates the LOG.info calls to include the nodename.

Change-Id: I69c66b84394b2a740a7ca9d2781015a7e1ff9998
Fix rendering of FixedIpNotFoundForNetworkHost

Fixes bug 1104000

With https://review.openstack.org/18319 a small bug was introduced. The
exception FixedIpNotFoundForNetworkHost is expecting network_id
parameter, and the change modified that parameter to network_uuid. This
patch fixes this problem at the raise point.

Change-Id: Idc0fa7fcba9ad37b73183f8811376c6c8adada68
Add debug log when call out to glance

Calling out to another service may take a while, so lets log this

Change-Id: I223105ee578ae82230cbc3936c096e148b07e8f1
Don't warn up front about libvirt loading issues in NWFilterFirewall

Use the same technique as in libvirt/driver.py to delay import of
libvirt module

Change-Id: I500ddde4651f0f747c54533a1a308eee5a87f717
Add Region name to quantum client

Looks like multi-region setups need the region name

Fixes LP# 1081037

DocImpact

Change-Id: Id8d5b1e1adef75a93df9a3527fd6da463fed0d09
Fix missing wrap_db_error for Session.execute() method

We should add wrap_db_error for Session.execute() method, because
Query.update() method will call Session.execute() and it is not inside
Session.flush(), so exceptions from Query.update() wouldn't be wrapped.

Add test for Session.flush() wrapper
Add test for Session.execute() wrapper

Fixes bug 1107890

Change-Id: I96894e502f9f279999b61a1e66469e34a07a022d
Fix boot with image not active

When boot with image which is not active, nova API response
with http status code 500. We should catch the exception and
raise HTTPBadRequest with more precise information.

Fix LP# 1108645

Change-Id: Ibd78f4b96bfdb925b03d7809d4e28afcc7e1ddcf
Move task_log functions to conductor

This moves the use of the following functions in compute/utils to
the conductor:

  task_log_get()
  task_log_begin_task()
  task_log_end_task()

This removes the db import from compute/utils.py

Related to blueprint no-db-compute

Change-Id: I6ed0563969afee78d9f2970308bc7f91e5690159
xenapi: Add support for different image upload drivers

This change refactors image upload code for xenapi and adds the
xenapi_image_upload_handler config option.

Preparation for bp nova-direct-image-upload
DocImpact

Change-Id: Icd4e7ef135beddca9ddcc4a880c09e5a1702a93c
Fixed grammar problems and typos in doc strings

Change-Id: Ia38397f46f12ffdf3024dbaca20956416e6a84d3
Merge "_sync_compute_node should log host and nodename"
Nova Hyper-V driver refactoring

Blueprint: hyper-v-testing-serialization-improvements

This patchset contains a major refactoring of the Hyper-V driver.

The main reason for this refactoring is to provide proper component
abstraction and decoupling, thus replacing almost entirely the remaining
pre-Essex code previously available. This leads to a considerable
semplification of the testing framework, which is now entirely based on
stubs and mocks (mox), without any serialized stub / mock.

From an architectural perspective, the main driver class delegates
operations to "ops" classes (e.g. VMOps, VolumeOps, etc) which contain the
main logic and delegate OS specific actions to "utils" classes (e.g. VMUtils,
LiveMigrationUtils, etc) where the WMI and Win32 API OS specific code resides.

Additional attention has been put also into a better PEP8 code formatting,
including compliance with not mandatory checks like E121 through E128.

Change-Id: I900719c02b7c6b48d44ca68903813a1dcd023f9f
Merge "Add version constraint for cinder"
Merge "Fix floating ips with external gateway"
Merge "Add Region name to quantum client"
Merge "Move task_log functions to conductor"