Change DB API instance functions for selective metadata fetching

This makes the DB API for instance_get_all() variants able to take a
columns_to_join parameter like the base instance_get_all() function,
which provides control over whether we go to the trouble of pulling
the metadata out of the database before we return the instances.

Related to bug 1164737

(cherry-picked from ba9cd2a545a0c198990f649b6a2985a22102930f)
Change-Id: Ie7c012e2e12bb91ef4294cdc90d828af255b67c5
get context from req rather than getting a new admin context

This patch removes the call to context.get_admin_context() and instead
obtains the context from the req object. Allowing the context.auth_token
to be reused.

Fixes bug 1161081

Conflicts:

	nova/api/openstack/compute/contrib/security_groups.py

Change-Id: I3b104edc2966fc3263fad824b1c4c99df832672e
(cherry picked from commit 1ea02dbcf5ae3e822378a580ac1e54467f664be7)
Query quantum once for instance's security groups

This patch adds the method get_instance_security_group_bindings()
which returns all the instance_id's and security groups for a given
tenant. This method is then used to avoid querying quantum for it's
security groups when using GET /v2/<project_id>/servers/detail.

Fixes bug 1161518

Conflicts:

    nova/tests/api/openstack/compute/contrib/test_security_groups.py

Change-Id: Ia28d5573c264f0316ab9fb257ca8e7ae35679883
(cherry picked from commit afeb95dfc924ed7e768d76bc5ae4bd4c55e9dcb3)
Merge "get context from req rather than getting a new admin context" into stable/grizzly
Merge "Query quantum once for instance's security groups" into stable/grizzly
Merge "Change DB API instance functions for selective metadata fetching" into stable/grizzly