Add PowerVM compute driver and unit tests.

part of bp:powervm-compute-driver

Change-Id: I9e55964b5260417d15b5def814ee305fce28c40b
Added several operators on instance_type_extra_specs.

The following operators on instance_type_extra_specs were added in
compute_capabilities_filter.py:

    = (equal to or greater than as a number; same as vcpus case)
    == (equal to as a number)
    != (not equal to as a number)
    >= (greater than or equal to as a number)
    <= (less than or equal to as a number)
    s== (equal to as a string)
    s!= (not equal to as a string)
    s>= (greater than or equal to as a string)
    s> (greater than as a string)
    s<= (less than or equal to as a string)
    s< (less than as a string)
    <in> (substring)
    <or> (find one of these)

If the first word in the instance_type_extra_spec is not one of the
keywords above, it is ignored.

E.g.: ">= 5", "s== 2.1.0", "<in> gcc", and "<or> fpu <or> gpu"

For more information, please refer:
    blueprint instance-type-extra-specs-extension.

Change-Id: Ief23d00449798577c6910aaef85f0cba26323c61
Adding port attribute in network parameter of boot.

Example is (network:[{‘port’:<uuid>}] )
The specified port will be used.
A port who have already device_id can not be used to be boot.
This fix is for isolating functionalities between Quantum and Nova.
There are no need update nova side if port model will be changed
in future quantum model.  This function is for QuantumV2 api use only.
Added port attribute in requested_network attribute. Fixes bug 1031096.

Change-Id: Id2c86228edb0c22f536f8b36a955c87870e9d98b
Port pre_block_migration to new image caching

This resolves bug 1036419, which was a missed call to _cache_image
when that method was refactored away.

Change-Id: I68f6aced5382e378dc707fd003d27dbfdd24aded
Merge "Added several operators on instance_type_extra_specs."
Remove unnecessary try/finally from snapshot

Revert part of 0eb53c0 which reverted part of d8d7100 :-)

The idea was that now that @reverts_task_state handles unsetting the
task state, we now longer need the explicit exception handling here.

However, we still absolutely need to unset task_state on the happy
path.

Change-Id: I08dd212626886a643f0321780f6d8a30c3a967e6
xenapi: remove unnecessary json decoding of injected_files

The API is responsible for decoding JSON an XML content. Also, the
code decoded results weren't used since the code below it would use
the original data anyway.

Also, add a unit test for injected_files in the xenapi driver.

Change-Id: Ie96b301b0948f92dd90060eacba0db9ae940b952
Defined IMPL in global ipv6 namespace.

* fix LP1014798

Change-Id: Ife2cc064128ee99a7ba1352f10c373812c69dd13
Merge "Adding port attribute in network parameter of boot."
Merge "Defined IMPL in global ipv6 namespace."
Merge "Port pre_block_migration to new image caching"
Merge "Add PowerVM compute driver and unit tests."
Change IPtablesManager to preserve packet:byte counts.

Modified IPtablesManager.apply() method to save/restore chain and
rule packet:byte counts by using the '-c' flag with iptables-save
and iptables-restore calls.  Currently they are zeroed every time
we change something in the table.  This will allow users to better
analyze usage for instances over an extended period of time, for
example, for billing purposes.

Change all applicable iptables, libvirt and Xen tests to account
for the changes made to support the packet:byte counts.

This work uncovered two bugs in the existing implementation
found during my testing, specifically:

1. Fix IptablesManager to clean-up non-wrapped chains correctly,
   instead of leaving them in the kernel's table.  We now keep a
   list of chains and rules we need to remove, and double-check
   in apply() that they are filtered-out.

2. Fix IptablesManager to honor "top=True" iptables rules by only
   adding non-top rules after we've gone through all the top rules
   first.

Implements first work item of blueprint libvirt-network-usage.

Fixes bug 1037127 and bug 1037137.

Change-Id: Ia5a11aabbfb45b6c16c8d94757eeaa2041785b60