Fix wrong regex in cleanup_file_locks.

The sentinel filename actually has form hostname-threadid.pid,
not hostname.threadid-pid.
Launchpad bug 1018586.
Change-Id: I09c01e0e63ee704b1485c196dc0b396ee03b2e5c
tests: remove misleading docstrings on libvirt tests

These docstrings take precedence over the method name,
to identify the test in the results.  So just remove
these misleading docstrings as they don't give extra
info over the method name itself.

Change-Id: I4c415f8c4be588f5de751ab8e4d21e85a18f6b75
refactor all uses of the `qemu-img info` command

* nova/virt/images.py: Define a single function that
calls `qemu-img info` in a robust manner, by avoiding
locale issues etc.
* nova/virt/libvirt/utils.py: Define secondary functions
to parse items returned from images.qemu_img_info().
* nova/virt/libvirt/driver.py: Use the libvirt.utils functions.
* nova/virt/disk/api.py: Likewise.
* nova/tests/test_libvirt.py: Remove no longer needed stub
for utils.execute('qemu-img info'). Adjust to a more restrictive
`qemu-img info` format, and more robust calling signature.
* nova/tests/test_imagebackend.py: Adjust to moved method.

Change-Id: I739dd246410c215f401ebd3a92b8207f46e8fb9a
Xen: Validate VHD footer timestamps.

This is a sanity check to ensure the footer timestamps on a VHD are
reasonable (e.g. not in the future). This condition can occur if the
local time for the source and destination machines in a migration are
not in agreement, requiring an adjustment to /etc/localtime and/or NTP
reconfiguration.

Without this check there is a risk of importing a corrupt VHD into the
SR causing the entire SR to become corrupted.

Change-Id: I17228e50d6f54632f3bfc32a682e511f876517ec
Return 400 in get_console_output for bad length.

Fixes bug 1027069. Prior to this fix if the length in the
request body was set to a non-integer value a error code of 500
was returned. The documentation also shows an integer in the
example request body.

The fix tests if the optional length is provided and
if it is either an "int" or "long". If not, a 400 error
is returned.

Additionally, cleaned up some error message to be more
descriptive.

Change-Id: I27a66fb1111e74665969f98e1101a9c37c665abc
Xen: Add race-condition troubleshooting script.

This stress-test runs builds and migrations concurrently making it
easier to uncovers certain types of race-conditions in the virt-layer
code.

Change-Id: I89c382b85aa6d0eb3dc957803f3ea34e3a36e9d4
Allow floating IP pools to be deleted

Fixes bug #1022237

If you delete all the floating IPs associated with a floating IP, the
pool still shows up in os-floating-ip-pools extension.

Fix this by using model_query() in the DB layer so that we ignore
deleted floating IPs.

Change-Id: I30d2e716e931400ca4b798b51bb26a73a7747808
Don't log debug auth token when using cinder.

Updates a log messages in the Nova cinderclient function so
it doesn't log the auth token from the request context.

Also properly localizes the log message.

Fixes LP Bug #1029049.

Change-Id: I89120f0e9b7a33c00b9b4b629d61d44d0e9b518f
Fix docstring for SecurityGroupHandlerBase

Change-Id: I645a03cd1a80dc34a7b5a2e91072604e5156d51d
Inject instance metadata into xenstore

When using Xenserver, inject instance metadata into the xenstore, for
the use of the instance.  Implements blueprint xenstore-metadata.

Change-Id: I88a59f1b783eaaaef6ba5efd8bd448aece2f869c
Add support for snapshots and volume types to netapp driver.

This is a continuation of blueprint netapp-volume-driver.

Change-Id: Ic79a98f3949c815f532e52a9b9d45ad7d8aa99ec
Handle NULL deleted_at in migration 112.

A NULL value in `instance.deleted_at` will cause the migration to break.
In the absence of instance deleted_at timestamp, we should be
conservative and skip cleanup.

Fixes bug 1029129

Change-Id: Ieb978281bc55727fb7db02ddc8c3e0fd6c8814f0
Merge "Allow floating IP pools to be deleted"
Merge "Handle NULL deleted_at in migration 112."
Merge "Return 400 in get_console_output for bad length."
Allow soft deletes from any state

At some point in the past, the compute manager's delete() method had
its @check_instance_state() decorator updated to allow deletes to be
performed from any combination of vm_state and task_state.  This same
change was not made to the soft_delete() method, and so soft_delete()
is only available if the task_state is clear, meaning that instances
that are put into ERROR state with task_state set to something are
effectively undeletable, if FLAGS.reclaim_instance_interval is set to
some non-zero value (which is what causes the API DELETE call to use
soft_delete() as opposed to delete()).  This patch updates the
@check_instance_state() on soft_delete() to match that on delete(),
and fixes bug 1029130 and bug 1029133.  This patch also partially
fixes bug 1029132, but more needs to be done to completely fix that
bug.

Change-Id: I78878110c696280f2bc28434433814884a526264
Merge "Inject instance metadata into xenstore"
Merge "Fix wrong regex in cleanup_file_locks."
Shrink Simple Scheduler

* The same functionality exists in the filter scheduler, except for
  nova volumes. So just keep nova-volume scheduling here.
* Add very basic Simple Scheduler testing
* Simple Scheduler will be completely removed after Folsom release

Change-Id: Ia2a2b26bc67cf152963533d68a774f454d763cbd
Include name in a primitive Instance.

This ensures that the name of an instance will be present in the result
of jsonutils.to_primitive(Instance).  The name isn't a column.  It's a
property that gets generated dynamically by the Instance class.

Part of blueprint no-db-messaging.

Change-Id: I45914ed55f2c037ee2efd7775bd57fbde36a2116