Move logs of restore state to inner logic

Currently when we rebuild instance, we will restore instance state
if it's STOPPED, but we will log it whenever it's STOPPED or not.
This may confusing operator and for ACTIVE/ERROR state, it's useless.
Also, adds instance into log to provide more info.

Change-Id: I0685484ee0b56c250071c8c9322d2ed053449fd3
libvirt: volume snapshot delete for network-attached disks

Add support for performing a volume snapshot delete for
a network/(libgfapi)-attached disk based on the proposal
at:

http://www.redhat.com/archives/libvir-list/2014-February/msg01226.html

Uses a new VIR_DOMAIN_BLOCK_COMMIT_RELATIVE flag for blockCommit
calls which keeps qcow2 backing file entries as relative filenames
rather than prepending them with path information when blockCommit
operations are performed.

Support for this flag is required and heuristically detected rather
than based on version number.

Selection of disk for blockCommit/blockRebase is handled by
searching the snapshot hierarchy and using an identifier such as
vda[2] meaning the second item in the snapshot chain for disk
'vda'.

Implements: blueprint libvirt-volume-snap-network-disk

Change-Id: I31710b787c39d23870fb45a460f460663ecb261c
Fix hacking check for jsonutils

Hacking checks with logical_lines should use yield not return.

The jsonutils rule was added in:
I86ed6cd3316dd4da5e1b10b36a3ddba3739316d3

Now that the function uses yield, it can trigger twice in dumps (dump
and dump), so look for a '(' at the afterwards. Don't display the '(' at
the end of the error message since its confusing to read.

Change-Id: I277dba08fdd30734409eee36008cebda35886968
Closes-Bug: #1356687
Hacking: a new hacking check was added that used an existing number

Commit 243879f5c51fc45f03491bcb78765945ddf76be8 added in a new hacking
check that used an existing number.

The new number is 324 (and not 323)

Change-Id: I7e604a408387438105c435ad16a1fa3d6491b642
Closes-bug: #1356815
Add EC2SnapshotMapping object

Create a nova object for the mappings between snapshot UUIDs and the
corresponding EC2 ID.

Part of blueprint convert-ec2-api-to-use-nova-objects

Change-Id: Ie29db77e404faff6ab9f12877094ea042e3c9924
Use EC2SnapshotMapping for creating mappings

Use the EC2SnapshotMapping nova object to create the mappings instead
of using the db api directly.

Part of blueprint convert-ec2-api-to-use-nova-objects

Change-Id: If280b1061185faf71c632a7bc4a8530346c18c97
Get EC2 snapshot mappings with nova object

Use the EC2SnapshotMapping nova object for getting the mapping instead
of directly using the db API.

Part of blueprint convert-ec2-api-to-use-objects

Change-Id: I258ffe0a3fe3b0d7b2524bb64f1137127731bdd5
Remove unused db api methods

Remove methods that are no longer used from the db API.  New methods
were created that replaced these when the EC2SnapshotMapping object
was created in earlier commits.

Related to blueprint convert-ec2-api-to-use-nova-objects

Change-Id: I5431dd34d6a3fcea687b9d8f192a822e83ed9402
ec2: Add S3ImageMapping object

Add a nova object for another ID-UUID mapping used in the EC2 API.
This object will allow the removal of the last bit of direct db api
usage by the EC2 API code.

Part of blueprint convert-ec2-api-to-use-nova-objects

Change-Id: Icf84f2d5a50ce4c78ee7f51db8e6a2b0276afbb2
ec2: Use S3ImageMapping object

Use the S3ImageMapping in the EC2 API to remove the last bit of direct
db API usage.

Part of blueprint convert-ec2-api-to-use-nova-objects.

Change-Id: I7d66a4d05f42ffd854afe21024c88b096aeaaeaa
Merge "libvirt: volume snapshot delete for network-attached disks"
Merge "Fix hacking check for jsonutils"
Merge "Hacking: a new hacking check was added that used an existing number"
Merge "Add EC2SnapshotMapping object"
Merge "Use EC2SnapshotMapping for creating mappings"
Merge "Get EC2 snapshot mappings with nova object"
Merge "Remove unused db api methods"
Merge "ec2: Add S3ImageMapping object"
Merge "ec2: Use S3ImageMapping object"
Merge "Move logs of restore state to inner logic"