Use env to set environ when starting dnsmasq

Explictly use env to setup needed environment variables for dnsmasq when
starting to avoid problems with subprocess mis-interpreting the first
command line argument as the executable name.

Also update DnsmasqFilter to accept any command that starts with env
followed by a set of args that include an equals sign, as long as the
next arg is the dnsmasq command.

fixes bug #1073253

Change-Id: I8ac08ba2d2309934a67ed2cb28049ed5d3277d63
Remove redundant code from PowerVM driver

This patch removes the dead instance cleanup from the
init_host() method in the PowerVM driver. Not only do
I think that it's redundant with the rest of init_host()
in compute_manager(), it's also examining the instance
task_state, which I think is a layering violation.

Tangentially related to bp/no-db-compute

Change-Id: Ie7eb4c07caa162f32021ccdbed51db950d30e2c7
Add call to reset quota usage

There are certain circumstances where we may need to indicate an
uncertainty in a user's current usage of a given resource, thus
forcing a recount of those resources currently in use.  This adds
a QUOTAS.usage_reset() call which can be used to do this.  It
works by resetting the current usage to -1, which will force the
usage record to be refreshed the next time that user reserves
those resources.

Change-Id: I4a40c8edcc78ed9a7d18a293d4d7d6418b04b7f2
Add scheduler retries for prep_resize operations.

Retry operations are subject to race conditions for compute resources.
prep_resize can race for resources on the destination host and
revert_resize can race for resources on the original source host.
This type of problem is handled for new instance build requests
by the resource tracker in compute.

As a first step to extending the resource tracker to cover resizes,
this patch adds scheduler retries around the prep_resize operation.

bug 1065267

Change-Id: I1b32c0a282772d9580e322b50990932016058329
Add rxtx_factor to network migration logic

Currently, when an instance is migrated from one host to another, the
only action the network API is able to take is moving floating IP
addresses.  We also need to be able to update the rxtx_factor value
to update QoS settings.  This change makes sure that the network APIs
will be passed the rxtx_factor value during a migration.

Change-Id: If4e1e96b84ee082c2d277c3d91da7df0325fc1ff
Fixes hypervisor based image filtering on Hyper-V

Fixes Bug #1073547

Nova scheduler's ImagePropertiesFilter based filtering requires the
"supported_instances" stat returned by the driver's get_host_stats method.
This fix implements the get_host_stats method, providing also some
refactoring in the process by adding a HostOps class.

Change-Id: Ia6e73eb3e8ff0be028854fe4fd6d8e305fa1d504
Merge "Add call to reset quota usage"
Merge "Add scheduler retries for prep_resize operations."
Merge "Use env to set environ when starting dnsmasq"
Merge "Remove redundant code from PowerVM driver"
Merge "Add rxtx_factor to network migration logic"
Merge "Fixes hypervisor based image filtering on Hyper-V"
Remove duplicate api_paste_config setting.

nova/tests/fake_flags.py does not need to set the api_paste_config
option twice. Remove the duplicate entry.

Change-Id: Id0d95d222a9c57c88abb3071c0b682f644747e20
Fix copy-paste bug in block_device_info_generation

Change-Id: If45a20d9e7cc0c332e3a3df1eaf22457f505acea
Move to a more canonicalized output from qemu-img info.

Move to a form that is all lower cased, dashes->underscores, underscores
instead of spaces which allows for better integration with python. Also
make the parser more robust to failures when encountering new fields such
as snapshot lists. Provide a new qemu img info object that can be used
to do the parsing and access the underlying attributes.

Change-Id: Ie098dbd9f06dd4ef966768e2caa128f1d09b019c
Merge "Fix copy-paste bug in block_device_info_generation"
Make bdms primitive in rpcapi.terminate_instance

This patch converts bdms (a list of block device mappings) passed to
nova.compute.rpcapi.terminate_instance to primitive types that are
safe to be sent to the rpc backend.

Also fixes the fake BDM classes used in:
* nova.tests.api.ec2.test_cloud
* nova.tests.api.openstack.compute.test_server_actions
to pass through josnutils.to_primitive properly and not confuse it due
to wrongly delegated dotted lookups

fixes bug #1073240

Change-Id: I329a48c1a53dde5895a329b39f32854c286de071
Merge "Make bdms primitive in rpcapi.terminate_instance"
Merge "Move to a more canonicalized output from qemu-img info."
Add some hooks for managers when service starts

Adds pre_start_hook() and post_start_hook() and fixes a couple of hard
coded binary name checks in service.py

Change-Id: I062790a88ed7f15a6f28961d6ddc1f230e19e0cb