Check the instance ID before creating it

At least with libvirt 1.x instance goes into shutdown state
before its ID is changed. This means that there's a race
condition during reboot where nova might try to create an
instance that's already defined. By checking if the ID of
the new and old instance is the same, we avoid that situation
and reiterate on the loop.

The tests for this are added in
I6215f80bd15820dac80151e7063916dbbc21d761

Change-Id: I493b828f0c6848fbadc591be2f47fd1b12fd3a51
Fixes: bug 1181924
Add tests for libvirt's reboot functionality

This patcha adds the missing tests for libvirt drivers reboot method.

Change-Id: I6215f80bd15820dac80151e7063916dbbc21d761
Stop creating folders in virt unit tests

Before nova.tests.virt.libvirt tests created 4 empty UUID named folders
in the top level nova directory.  Tests should not leave artifacts like
these around.

Fix bug 1194676

Change-Id: I941b23ecb94db2f4a0cc60eeb06766f960775ba1
xenapi: Improve cross-device linking error message.

Catch invalid-cross device linking exceptions raise from os.rename
and provide a more intelligible error message.

Change-Id: I22b6a145141431b6d4e4cb0176881f0cf0dd609f
xenapi: Make BitTorrent url more flexible

Change xenapi bittorrent plugin to not assume that torrent file
is under CONF.xenapi_torrent_base_url + image_id + ".torrent".

This allows for sources images from arbitrary torrent URLs.

Change-Id: Ica9462a51c6299b5affc861781f3054d18866458
Add obj_to_primitive() to recursively primitiveize objects

Occasionally we need to recursively process a NovaObject into a
representative dict or list. This patch adds a function to do that
recursively, accounting for nested objects and lists of objects.

Related to blueprint unified-object-model

Change-Id: I6adb84f9e5a0564ec4af14200e26e838b4a5bb6e
Add update() method to NovaObject for dict compatibility

In order for objects to behave like dicts, they need to
support the update() method. This patch adds that.

Related to blueprint unified-object-model

Change-Id: Icb3932682285cbf8e7362e5b748e42a754b17fe7
Port flavor_access extension to v3 API Part 1

This changeset only copies the v2 files (implementation and test)
into the appropriate v3 directories unchanged. The copy as-is
will not be loaded by either the v2 or v3 extension loaders. The
second changeset will then make the changes required for it to
work as a v3 extension.

This is being done in order to make reviewing of extension porting
easier as gerrit will display only what is actually changed for v3
rather than entirely new files

Partially implements blueprint nova-v3-api

Change-Id: I6a2648ac9f59ff122f06a63991b57e595b2c5696
Merge "Stop creating folders in virt unit tests"
Merge "Add obj_to_primitive() to recursively primitiveize objects"
Merge "Add update() method to NovaObject for dict compatibility"
Merge "Check the instance ID before creating it"
Merge "Add tests for libvirt's reboot functionality"
Merge "Port flavor_access extension to v3 API Part 1"
Merge "xenapi: Improve cross-device linking error message."
Merge "xenapi: Make BitTorrent url more flexible"