implement sql-comment-string stack traces

Implements solution for bug 1007648.

Add python stack traces to all sql comment strings so that someone
looking at database query logs can immediately see what code
generated each query. This is especially powerful when combined
with pt-query-digest to get per-file or per-method aggregates.

Change-Id: Ieda5cf4d70cc2643d27fb00efb48de14ca2abe52
Log connection_type deprecation message as WARNING

Updates the connection_type log messages to log as
a warning instead of an error.

Fixes LP Bug #1011788.

Change-Id: I4cc2d9d5fdea2c8871f760b73a905fe61edcbe8f
Remove utils.deprecated functions.

We don't seem to use utils.deprecated at all... so lets
remove it and save ourselves 200 lines of code.

Also moves a couple misc. test cases in utils.py out of the
DeprecationTest suite and into the GenericUtilsTestCase
suite.

Change-Id: I03f71f2ee06a526a8902a3079257afd6fd65dc59
Add two missing indexes for instance_uuid columns.

sqlite has these indexes because they were in the sql scripts, but
they're missing from the other database engines.

Change-Id: I2a1935f6eb577d2c3d2eb177c083ad647f76f58f
Dedupe native and EC2 security group APIs.

Reduce the code duplication in the native openstack and EC2 APIs
related to security groups, by factoring commonality into a new
internal SecurityGroupAPI.

Also fixes bug lp 1005931

Change-Id: Ifb92bf5d0f07d5713818a3eee6175ef03e8c0b7c
Add support for configuring libvirt VM clock and timers

There are a number of time sources made available to guests,
each of which have a number of configurable policies. This
introduces config APIs for the libvirt domain XML to configure
the clock time sources

Change-Id: Ic5047b02b4753f20bb9a63e85130d84258df7a28
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Update default policies for KVM guest PIT & RTC timers

The default policies for the KVM guest PIT and RTC timers
are not very good at maintaining reliable time in guest
operating systems. In particular Windows 7 guests will
often crash with the default KVM timer policies, and old
Linux guests will have very bad time drift

Set the PIT such that missed ticks are injected at the
normal rate, ie they are delayed

Set the RTC such that missed ticks are injected at a
higher rate to "catch up"

This corresponds to the following libvirt XML

  <clock offset='utc'>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='rtc' tickpolicy='catchup'/>
  </clock>

And the following KVM options

  -no-kvm-pit-reinjection
  -rtc base=utc,driftfix=slew

This should provide a default configuration that works
acceptably for most OS types. In the future this will
likely need to be made configurable per-guest OS type.

Fixes LP bug #1011848

Change-Id: Iafb0e2192b5f3c05b6395ffdfa14f86a98ce3d1f
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Remove unused DB calls

Fixes bug 1012301: Remove unused Cells code

Change-Id: I7e78e7c4ae3b099c775be2acc54b37f1e1b9883e
blueprint lvm-disk-images

Add ability to use LVM volumes for VM disks.

Implements LVM disks support for libvirt driver.

VM disks will be stored on LVM volumes in volume group
 specified by `libvirt_images_volume_group` option.
 Another option `libvirt_local_images_type` specify which storage
 type will be used. Supported values are `raw`, `lvm`, `qcow2`,
 `default`. If `libvirt_local_images_type` = `default`, usual
 logic with `use_cow_images` flag is used.
Boolean option `libvirt_sparse_logical_volumes` controls which type
 of logical volumes will be created (sparsed with virtualsize or
 usual logical volumes with full space allocation). Default value
 for this option is `False`.
Commit introduce three classes: `Raw`, `Qcow2` and `Lvm`. They contain
 image creation logic, that was stored in
 `LibvirtConnection._cache_image` and `libvirt_info` methods,
 that produce right `LibvirtGuestConfigDisk` configurations for
 libvirt. `Backend` class choose which image type to use.

Change-Id: I0d01cb7d2fd67de2565b8d45d34f7846ad4112c2
Merge "implement sql-comment-string stack traces"
Log warnings instead of full exceptions for AMQP reconnects.

Fixes bug 1010147.

Change-Id: I1af7614330307dfdf5c723710334a168bc30b50f
Merge "Remove utils.deprecated functions."
Merge "Log connection_type deprecation message as WARNING"
Merge "blueprint lvm-disk-images"
Merge "Log warnings instead of full exceptions for AMQP reconnects."
Merge "Add support for configuring libvirt VM clock and timers"
Merge "Update default policies for KVM guest PIT & RTC timers"
Merge "Remove unused DB calls"
Merge "Add two missing indexes for instance_uuid columns."
Re-add private _compute_node_get call to sql api.

Re-adds a private _compute_node_get call to the sql api.
This call is in used by the compute manager.

Fixes LP Bug #1013061.

Change-Id: I28c578509ac70ac7bccede41c3210a46ae56e717