ensure zeros are written out when clearing volumes

Note O_DIRECT is _not_ used at the end of devices to
avoid issues with odd sized blocks etc. so instead
we arrange to have dd issue an fdatasync()
to ensure the data is persisted, lest it be discarded
from the write cache when the device is unprovisioned.

* nova/virt/libvirt/utils.py (clear_logical_volume): Add 'conv=fdatasync'
to the dd option list if O_DIRECT isn't used when clearing.

Fixes bug: 1100363
Change-Id: I76789557754ebaeb6d52bb34548a2ef17808fbf6
allow disabling file injection completely

With the libvirt_injection_partition config set to -2,
file injection is avoided completely.

This can be required if you want to make user specified files
available from the metadata server (and config drive is not enabled),
then you would want to avoid injection completely for performance reasons,
but also to avoid boot failure if the injection itself failed.

Flags: DocImpact
Change-Id: I604f4189114515c70c58cf183622542c4633e44a
l3.py,add_floating_ip: setup NAT before binding

fix for bug 1100435

Change-Id: Iad022f61297fe26edb230ba7b9e31d73df99b5a5
Use joined version of db.api calls

Replace db.instance_get_active_by_window with
db.instance_get_active_by_window_joined

Remove db.instance_get_active_by_window as it is now unused

When moving over to nova.db.api not returning sqlalchemy
objects non-joined db calls (lazy loaded) won't work.

Partially implements bp db-api-cleanup

Change-Id: Iec647792a049d53862a45f95accd7f46e483aa17
Update nova/compute/api to handle instance as dict

When nova.dp.api returns primitives instead of sqlalchemy objects
instance objects will be dictionaries, which cannot be added to sets
('dict' is an unhashable type)

Partially implements bp db-api-cleanup

Change-Id: I3683d1c54ae627d9cabfd569a7fd304c47c5d5b7
Update jsonutils from oslo-incubator

Change:
a878193 Allow to_primitive to ignore datetimes

Change-Id: I2c83b259c24768a546c3090a72cfecef2d6c4d1a
Fix missing key error in libvirt.driver

The libvirt disk mapping refactor change introduced
a bug in libvirt.driver.get_guest_config where we were
attempting to perform instance_update using a non-existent
key in the disk_mapping.

Given that we already parsed out the root_device_name and stored
it in a variable, and then verify that it's set in an if
statement before this method we should be just using what
we've already parsed.

Fixes bug: 1118829

Change-Id: Ifd80e67740d6f257ee537b68e9afe028273484d2
Merge "Fix missing key error in libvirt.driver"
Merge "allow disabling file injection completely"
Merge "ensure zeros are written out when clearing volumes"
Merge "Use joined version of db.api calls"
Merge "Update nova/compute/api to handle instance as dict"
Merge "Update jsonutils from oslo-incubator"
Merge "l3.py,add_floating_ip: setup NAT before binding"