Change listen address on libvirt live-migration

Previously, in order for libvirt live migration to work,
the graphics listen addresses (VNC and/or Spice) had to be
set on both machines to be 0.0.0.0 or ::.  This was because libvirt
would try to rebind to the source address on the destination
machine, but would fail due to the source machine already having
that address (this would not happen for 0.0.0.0 or ::, however).

Now, a modified copy of the instance's XML is passed to libvirt's
migrate function, such that the listen addresses are that of the
destination machine.  The addresses are stashed in the pre-migration
data by the destination pre-migration method.

Note that this functionality will only work on versions of libvirt
with the VIR_DOMAIN_XML_MIGRATABLE flag.  If the flag is not detected
(anything vanilla libvirt less than 1.0.0), the live migration code
will fall back to the old method.

Fixes: bug #1279563

Change-Id: I6c9500283027193179c11d18ad4242e165a9ad6e
Bump hacking to 0.9.x series

Hacking 0.9.0 had a minor bug so require 0.9.1 or higher.

In order to keep this patch to just a requirements bump, ignore new and
stricter hacking rules that are being triggered. Fixing up the code and
turning these on is out of scope of this patch and is for future patches.

Change-Id: Iafbd4adae8c6b446d53b62dfc490eab8e76a43ac
Fix H401,H402 violations and re-enable gating

H401 and H402 got stricter in hacking 0.9, so fix new violations and
re-enable gating.

Change-Id: I4785d14edee1ffdf32e2900f6e6234cbecab6d8a
Merge "Revert "Remove quota-class logic from context and make unit tests pass""
Merge "Revert "Remove broken quota-classes API""
Merge "Handle string types for InstanceActionEvent exc_tb serialization"
Merge "Add read_only field attribute"
Merge "Simplify filter_scheduler.populate_retry()"
Remove XML namespace from some v3 extensions

The XML support was removed from the V3 API plugins,
this XML namespace was not used again.

Change-Id: I427597dd3f6d454037a791f911756a97f343966d
Remove variability from object change detection unit test

Insure hashes of object representations are consistent by normalizing
data using sorted lists (as compared to dictionaries whose keys and
values are listed in an arbitrary, variable, dependent order:
https://docs.python.org/2/library/stdtypes.html#dict.items).

Closes-Bug: #1325246

Change-Id: I1344a820263683a024818d181ec6ee08e5e18984
Merge "Remove duplicate method"
Merge "Correct exception handling when create aggregate"
Merge "libvirt: Remove dated docstring"
Merge "Move set_admin_password tests from test_compute.py to api/mgr modules"
Fixes hyper-v volume attach when host is AD member

The domain name gets added to the initiator name used by the host
if it's an Active Directory member.

Currently the method which gets the initiator name does not take
this into account when retrieving the default initiator name.

Trying to use a wrong initiator name will lead to an exception when
trying to log in to the according iSCSI target.

This patch simply appends the domain name (when the host is an AD
member) to the initiator name used to log in to iSCSI targets.

Closes-Bug: #1328870

Change-Id: Ifbe762c685e46081059a01043431b2c4ac5473fc
Virt: remove unnecesary return code

The methods attach_volume, detach_volume and swap_volume should
not return anything.

The purpose of the patch set is to have a consistent behaviour across
drivers for the aforementioned methods.

Change-Id: I381ede44d71cd5f6ce98804853e4e8f587b46c99
xenapi: move find_vbd_by_number into volume utils

Above function is only used in volumeops, so moved to volume_utils.
Also added some unit tests to cover that function.

Change-Id: I1298dd35d8a41832475c6d6bd908af8f6576be82
Separate the PCI device object handling code

Currently the PCI device object includes several functions like
alloc/free/claim etc. However, the NovaObject should not be used
this way, and it makes the PCI device object really different
with other NovaObject implementations.

This patch duplicates the PCI device handling code as separated
functions. No logic changes but simply code copy. A later patch
will delete the code at PciDevice object.

Closes-Bug: #1273852

Change-Id: I2389d29218d8619998f8df973004af004e8b1b76
Use new pci device handling code in pci_manager

As we remove some pci device method from PCI device object,
update the pci manager accordingly.

Closes-Bug: #1273852

Change-Id: I0ec0e7b03625888a207918816b6e2d537b6d7d54
Remove the device handling from pci device object

Remove the device handling code at pci device object to make
it similar to other NovaObject.

Remove some usage in test cases.

Closes-Bug: #1273852

Change-Id: I4487ae0b36de18365d12593f480c05f0fe726769