Fix instance can not be deleted after soft reboot

The reason is that:
1. soft reboot will wait for instance become to 'shutdown', and then start it
2. delete operation also wait for this, and then clean up the instance
3. if soft reboot found the instance become to 'shutdown' firstly, it will
start it immediately
4. then the delete operation will go to the _wait_for_destroy loop, and the
loop may be endless
5. when we delete the instance again, because the lock was hold by the delete
operation before, this one will wait the lock and don't implement actually.
So the domain id is checked during _wait_for_destroy loop, if it changed and
the instance is still running, we need to destroy it again.
If the domain is booted after _wait_for_destroy, it may result in
unfilter_instance failed because the nwfilter is in use, so doing the same
thing as above.

Fixes Bug #1111213

Change-Id: I98dc902dd86fa828f5821465c611953e08f9f637
Prevent the unexpected with nova-manage network modify.

"nova-manage network modify" can misinterpret arguments if the user
provides values where they are unexpected, specifically the
--disassociate-project and --disassociate-host options. If the user
provides a project or hostname value for either of these values, it will
be interpreted as a positional argument and modify handler may behave as
if other options were provided (e.g. project or host).

This change handles the presence of a project or host option along with
--disassociate-project or --disassociate-host as an error, printing a
message and exiting immediately with an error code. While there are
other approaches (e.g. perform the disassociate modifications while
ignoring the others), preventing unexpected or inconsistent results by
doing nothing seems safest.

Change-Id: Iff7817fe3ed19a4ff330b4029f9c558d3b405e9b
Retry bw_usage_update() on innodb Deadlock

Adds a new decorator _retry_on_deadlock() to sqlalchemy api.  This patch
makes bw_usage_update() use it.

Fixes bug 1129622

Change-Id: I0293c62d2dd5ac036445bc639cabbd05ba016e83
Fix leak of loop/nbd devices in injection using localfs

Call do_teardown() rather than do_umount()

bug 1130080

Change-Id: I0dd4e4990f75917628007fd380f7df531d9a79e5
Enhance IPAdresses migration tests

This enhances IPAddresses tests to check if the migration goes fine with longer
IPv6, and with ipv6 that can be shortened (postgresql uses shortened form,
mysql and sqlite doesn't).

Also enhances cidr tests to check migration of shortenables cidrs, and cidrs
that postgresql suppress its prefix, like 10.0.0.0/32 cause it is pretty much
the same as 10.0.0.0

Partially implements bp migration-testing-with-data

Change-Id: I11dfc8fda7034a46a6bc067294ac8e88ca43b508
Add an extension to show image size.

Adds image size data that is returned from Glance into the API response.
This becomes really useful for users when they take a snapshot and want
to track the storage used by it.  Since this information is already
being pulled by Nova we should display it.

DocImpact
Change-Id: I8a2d4001c21bcc54cac1a2992034dfc9fbe39d7e
Fix instance directory path for lxc

Commit 12b8bd380e22a40e10e9d2758f5a0d594517de51 triggers a regression
when starting a STOPPED LXC instance. Instance referecne is needed to
correctly setup container rootfs path.

Change-Id: Id55b7f3a631e80a0da3f52c55784414105a61142
Fix broken logging imports.

This fixes all of the files incorrectly importing logging directly
and removes the workaround in hacking.py that was due to improper
from nova.openstack.common.log import logging statements.

Change-Id: Icfc25dc148c4a7b5fa7f6a7b609cd6c3d94efee1
Fix pep8 issues with test_manager.py

Fixes E231 (missing whitespace) problems with
nova/tests/network/test_manager.py

Change-Id: I99d4c3bf7ed1a137fbfb26e9fe2f31d9104d5ae4
More gracefully handle TimeoutException in test

Sometimes although the test_killed_worker_recover test passes, the
cleanup of a forked child takes too long and a TimeoutException
occurs. This patch better handles the TimeoutException and
ensures the child process is killed.

Fixes bug #1128574

Change-Id: I39ea2fbb6c9cb95ad10b68bfa216686467951a93
ensure we run db tests in CI

CI had a set of environmental variables that refused to allow the
tests from failing gracefully. These seem to have gotten lost
along the way in refactoring.

Change-Id: Ib19b5d472c51ed72b8acf1571dd19f41474532c5
Refactor nwfilter parameters

* libvirt < 1.0.1 does not allow dynamically updating filter
  parameters inside an interface block of theinstance XML. To
  address this we move the nwfilter paramters from the instance
  XML to the per-instance base nwfilter.

Relates to bug #1124722

Change-Id: I50ec5dcffa8ff0232ae0aba0a08fce5151962238
Make add-fixed-ip update nwfilter wth in libvirt

Add inject_network_info to the libvirt driver  so that the
add-fixed-ip call will trigger a refresh of the nwfilters.

Change-Id: I00eccf34b8f92fb1e26a72e4bddb47dd39c4558f
Fixes: bug #1124722
Sync latest install_venv_common.py

Syncs:

  c78b2ab Avoid using cfg in install_venv_common

So that people don't need oslo-config installed to run install_venv

Change-Id: I05b69f043b276d5e6cd2df5d90bc679df6373383
Merge "Fix leak of loop/nbd devices in injection using localfs"
Sync rpc from oslo-incubator.

This includes the following changes:

 * use oslo.config directly
 * implementation of rpc-amqp-fast-reply-queue
 * simplifications to bin/nova-rpc-zmq-receiver
 * add new join_consumer_pool API call
 * a bug fix to ensure kombu messages get acked even when an exception
   occurs in the message callback

Change-Id: I813ce0ee7d5442d7b5b0f9d477949adabc83174e
Log lifecycle events to log INFO (not ERROR)

By default we would prefer not to see lifecycle events getting
logged to Nova's compute.log file as errors.

Fixes LP Bug #1130686.

Change-Id: I10899e0c89ab922c48370d107ab496902ccc8c77
Add API Sample tests for Hypervisors extension.

Partially implements blueprint nova-api-samples
Fixes bug 1091750

Change-Id: Ie8e6881ea3533cd43259548594d3debe377345a5
Removed duplicate spawn code in PowerVM driver

After introducing resize/migrate in PowerVM there was
some code that was duplicated after a rebase. The commit
removes the duplicate code. The functionality of
resize/migrate remains the same as introducted in
Change I72345626

Bug #1130680

Change-Id: I1fe3d8e1f2a19fd40a03c8c38d90c01711356b38
Merge "Enhance IPAdresses migration tests"