Delete the test_preparing_xml_info libvirt test

The test_preparing_xml_info test case is about to be intentionally
broken by refactoring in following patches. It will be replaced
by a new test at the end

blueprint libvirt-xml-config-apis
Change-Id: I2c5f19a071983e581ed5ed3bc8a84e14fbb6897b
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Convert libvirt volume classes over to use config API

The classes in the libvirt/volume.py file build up XML
strings using printf style substitutions. Convert this
over to use the LibvirtConfigGuestDisk config class
instead

blueprint libvirt-xml-config-apis
Change-Id: Ied1fad47db6fb23b74edc4405015768c764a4d10
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Convert libvirt vif classes over to use config API

The classes in the libvirt/vif.py file build up dictionaries
and partial XML snippets, which are then passed onto Cheetah
templating for XML generation. Instead of building up
dictionaries of parameters, return LibvirtConfigGuestInterface
object instances instead

blueprint libvirt-xml-config-apis
Change-Id: I4e977225e21219f408dd729ac280dcbfc6b8ba8f
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Convert libvirt connection class to use config APIs for graphics

Remove the <graphics> element from the Cheetah XML template and
make the libvirt connection class use the LibvirtConfigGuestGraphics
class for it instead

blueprint libvirt-xml-config-apis
Change-Id: Ifa18cab2aa6983c9439c6230a9109e40a6a0bbe3
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Convert libvirt connection class to use config APIs for serial/console devices

Remove the <serial> and <console> elements from the Cheetah XML template
and make the libvirt connection class use the LibvirtConfigGuestConsole
and LibvirtConfigGuestSerial classes for them instead

blueprint libvirt-xml-config-apis
Change-Id: I67031dad2969c9b36e2fe9230689c1b7bfbecfce
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Convert libvirt connection class to use config APIs for input devices

Remove the <input> elements form the Cheetah XML template
and make the libvirt connection class use the LibvirtConfigGuestInput
class for it instead

blueprint libvirt-xml-config-apis
Change-Id: I4fba2ddae2d32b0ff49685245fd905651885b61b
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Convert libvirt connection class to use config APIs for disk devices

Remove all the <disk> elements from the Cheetah XML template
and make the libvirt connection class use the LibvirtConfigGuestDisk
class for them instead

blueprint libvirt-xml-config-apis
Change-Id: I0f09a86e72e5e34bbd780b31177a65eb40fb5419
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Move NIC devices back after disk devices

Originally the NIC devices were listed in the XML after the
disk devices. Restore that order, simply for consistency.
No functional change.

blueprint libvirt-xml-config-apis
Change-Id: If62446292850d58e133b0c4cc42ca83018e1fca1
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Introduce a class for storing libvirt snapshot configuration

Extend the libvirt config APIs to include a new class
LibvirtConfigGuestSnapshot for storing information about
guest snapshots

blueprint libvirt-xml-config-apis
Change-Id: Icc54f6f5cf41b05d904659e0a337bddb4bef5733
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Convert libvirt connection class to use config APIs for filesystem devices

Remove the <filesystem> element from the Cheetah XML template
and make the libvirt connection class use the LibvirtConfigGuestFilesys
class for it instead

blueprint libvirt-xml-config-apis
Change-Id: I9dad031703161d1dff86af03eff7b1ebf657fc0c
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Convert libvirt connection class to use config APIs for guests

Remove the entire Cheetah XML template for libvirt guests
and make the libvirt connection class use LibvirtConfingGuest
classes instead

The nova 'libvirt_xml_template' config parameter is now obsolete
and removed.

blueprint libvirt-xml-config-apis
Change-Id: I5ff4ed7cbc69c8c141db840f4d6fc368a13f7f7a
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Introduce a class for storing libvirt CPU configuration

Extend the libvirt config APIs to include a new class
LibvirtConfigCPU for storing host/guest CPU configuration
data

blueprint libvirt-xml-config-apis
Change-Id: Ib508637c1e0ca69860d461b0a480347c59165e6b
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Convert libvirt connection class to use config APIs for CPU comparisons

Currently the libvirt connection class uses a Cheetah template to
build up the CPU XML document, for doing host CPU comparisons.
Remove this template and replace it with use of the new config
API LibvirtConfigCPU

The nova 'cpu_xml_template' configuration parameter is also removed since
it is now obsolete

blueprint libvirt-xml-config-apis
Change-Id: I1d608f5f9d77302a9e08486f67ad3a39b224e9d5
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add a test case for generation of libvirt guest config

Replace the test case for checking XML template info which was
deleted earlier, with a new test case checking the XML config
objects.

blueprint libvirt-xml-config-apis
Change-Id: I1ddd945111dcde0e67aba280bf0d11a8dab6c44a
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add periodic_fuzzy_delay option.

Fixes bug 962665

This random delay is intended to reduce the stampeding behavior
associated with periodic tasks when compute workers are restarted in
unison across a cluster.

Change-Id: Ie3771d94af29049061c129b8ea562ee447a61771
Reordered the alphabet.

Just putting this out there... I'm pretty sure that

   import nova.flags

comes after

   from nova.endpoint import cloud

Unless I'm totally misunderstanding how this is supposed to work,
which is likely.

Change-Id: I51096ab25dbca42d73a593872b83b25f2c451210
makes volume versions display properly

 * The compute versions controller changed during a refactor and broke
   the volume versions controller (since we are using it as a base class)
 * Added naive test
 * fixes bug 963357

Change-Id: Ica9c65952b800d316d264db11f89e369e56bcade
Import recent openstack-common changes

Fixes MultiStrOpt, plus also adds secret kwarg for sanitizing logs

Change-Id: I87b979b38084f82b012872054262fc49d291e99e
Merge "Add periodic_fuzzy_delay option."
ensure atomic manipulation of libvirt disk images

This pattern could probably be used elsewhere,
but only libvirt disk images are considered for now.
This change ensures there are no stale files left
anywhere in the path from glance, through the libvirt image cache.
These could cause subsequent operational errors either
directly or indirectly through disk wastage.

* nova/utils.py: Add a new remove_path_on_error() context manager
that is used to remove the passed PATH on a raised exception.
* nova/virt/images.py: Ensure temporary downloaded and
converted images are protected.
* nova/virt/libvirt/connection.py: Ensure all the images in
the image cache and instance dirs are protected.

Change-Id: I81a5407665a6998128c0dee41387ef00ebddeb4d