VMware: Ensure Quantum networking works with VMware drivers

Fixes bug 1202042

A new utility method, is_quantum, is added. This returns True
if Quantum is used by the network_api_class.

(cherry picked from commit 2d7520264a4610068630d7664eeff70fb5e8c681)

Change-Id: Iaf22a43c8e36a7e5825574a082491354e4523619
Fix Qpid when sending long messages (from oslo)

This is commit 4f97479ad in oslo-incubator

Qpid has a limitation where it cannot serialize a dict containing a
string greater than 65535 characters. This change alters the Qpid
implementation to JSON encode the dict before sending it, but only if
Qpid would fail to serialize it. This maintains as much backward
compatibility as possible, though long messages will still fail if they
are sent to an older receiver.

The first part of this fix was ported to Grizzly in Ib52e9458a to allow
receiving messages from Havana using the new format. Even though this
change will modify the message format, it will only do it when messages
are longer than 65K which would be broken anyway and could cause serious
bugs like the one linked below.

Fixes bug 1215091

Change-Id: I505b648c3d0e1176ec7a3fc7d1646fa5a5232261
Make nbd reservation thread-safe

Avoid the situation where two local threads choose the same nbd number
for injecting files into the instance. If this happened quickly enough
nova was left with one qemu-nbd hanging and blocking the device forever.

Fixes bug 1207422

Change-Id: I18864b19ebd30669534e45ca7a50e12f61207302
(cherry picked from commit e4ed9e3726b87e4f37138867f752b0588f3626a0)
Merge "VMware: Ensure Quantum networking works with VMware drivers" into stable/grizzly
Merge "Make nbd reservation thread-safe" into stable/grizzly
Merge "Fix Qpid when sending long messages (from oslo)" into stable/grizzly
Merge branch 'stable/grizzly' of https://github.com/openstack/nova into grizzly/stable