Merge "create new cidr type for data storage"
Merge "Fix a typo in two comments.  networksa -> networks"
Merge "Remove unused db calls"
Merge "Remove unused db calls from nova.db.sqlalchemy.api"
Merge "Fix _get_instance_volume_block_device_info call parameter"
Merge "Remove unused nova.db.api:network_get_by_instance"
Merge "Delete baremetal interfaces when their parent node is deleted"
Fix leak of loop/nbd devices in injection using localfs

Call do_teardown() rather than do_umount()

bug 1130080

Change-Id: I0dd4e4990f75917628007fd380f7df531d9a79e5
Documentation cleanups for nova devref

This patch contains a number of cleanups of the nova devref,
mostly related to outdated content.

1) remove outdated todo items from network
=> these have been long covered in the manuals

2) remove outdated multinic docs and images
=> this is now better covered in:
http://docs.openstack.org/trunk/openstack-compute/admin/content
/using-multi-nics.html

3) remove outdated cloudpipe docs, confs and scripts
=> This is now better covered in:
http://docs.openstack.org/trunk/openstack-compute/admin/content/
cloudpipe-per-project-vpns.html

4) remove outdated networking docs
=> These were marked as 'legacy' more than 2 years ago

Change-Id: I9321335031b4581c603a6f31c613e1b620d468a6
Add a safe_minidom_parse_string function.

Adds a new utils.safe_minidom_parse_string function and
updates external API facing Nova modules to use it.
This ensures we have safe defaults on our incoming API XML parsing.

Internally safe_minidom_parse_string uses a ProtectedExpatParser
class to disable DTDs and entities from being parsed when using
minidom.

Fixes LP Bug #1100282.

Change-Id: Ib90d6379320ff1d007f8a661f7ddaa286ba6918e
Fix key check in instance actions formatter.

The 'key in object' check doesn't work for sqlalchemy models so nothing
was getting copied over during the format.  This patch switches to using
get() to retrieve a value.

Bug 1126593

Change-Id: I726c2a624928247de41a077c23fe80742cbf9044
Add basic infrastructure for compute driver async events

This introduces the basic infrastructure to allow compute
drivers to emit asychronous events for processing by the
virt API. Initially the only event defined is a "lifecycle"
event which allows the virt API to immediately detect the
start and stop of virtual domain instances, without needing
to frequently poll the compute API.

The base compute driver gains a method enabling the manage
to register a callback to receive events, and another method
to allow driver subclasses to emit events.

Blueprint: compute-driver-events
Change-Id: Ic9abcd3f829c106e840538a01376862ab5b3485b
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
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 support for lifecycle events in the libvirt driver

This wires up the libvirt compute driver to process async
events from libvirtd and emit lifecycle events. This makes
use of the native libvirt event loop to handle I/O processing
which requires a native thread.

The native thread uses a queue + self-pipe to forward events
onto a green thread. The green thread reads events off the
queue and uses the emit_event method to dispatch them to the
compute manager.

Blueprint: compute-driver-events
Change-Id: Icd2cb7081adde10420ae55beebe60350afe21379
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Handle lifecycle events in the compute manager

Update the compute manager to register an event handler
with the compute drivers. The initial handler will process
lifecycle event notifications, to allow prompt synchronization
of DB & hypervisor power states. This means that if a guest
admin does 'shutdown -h now' the libvirt driver in Nova will
immediately notice that and mark the guest as SHUTOFF rather
then leaving it RUNNING until the periodic task runs sometime
in the next 10 minutes

Blueprint: compute-driver-events
Change-Id: I39a6d450a6d6384b8be58aceea98e4395185cc38
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add support for network adapter hotplug.

    This patch makes it possible to add/del instance
    interface other than booting time.
    Implement bp:network-adapter-hotplug

Originally from change Ibee003a9ec6cc9b3fd275417caccd0c67f6c871f

Co-authored-by: Yaguang Tang <heut2008@gmail.com>
Co-authored-by: Édouard Thuleau <edouard.thuleau@orange.com>

Change-Id: I4f8f677af58afcb928379e5cf859388d1da45d51
Fix XML config tests for disk/net/cpu tuning

Due to a bug in the XML matching code, some XML formatting
problems related to disk/net/cpu tuning were not flaged as
errors. The problems were all simply ordering of the elements.
This patch also fixes some indentation problems at the same time

Fixes bug #1130146
Change-Id: Iee392ed823002b8231b33c27b487c2538b2dc8cd
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Fix XMLMatcher error reporting

The nova.tests.matchers.XMLMismatch class implements the
get_details() method returning a dictionary with the expect
and actual XML output. It is returning a string values, but
the testtools code requires that the dictionary values are
instances of the testtools.content.Content object.

To quote the 'get_details' docs on testtools.matchers.Mismatch

     :return: a dict mapping names to Content objects. name is a string to
         name the detail, and the Content object is the detail to add
         to the result. For more information see the API to which items from
         this dict are passed testtools.TestCase.addDetail.

Related bug #1130146
Change-Id: I75ec07d8b34b04c7b8009229fda49b344ed13bec
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Merge "Assign unique names with os-multiple-create."
Merge "Stub additional FloatingIP methods in FlatManager"