Don't elevate context when rescheduling

The rescheduled launch should be executed with the same context
as the original request, so make sure that we aren't passing an
elevated context to reschedule.

Change-Id: Ic528f10067fa2977cc375c41b9c65d3517524ff8
Resolves-bug: 1366181
Fixes network_get_all_by_host to use indexes

The OR in the subquery was constructed in a way that didn't allow
the fixed_ips without instances allocated to be filtered out. It
also had an unnecessary join through virtual interfaces. We have a
denormalized field for instance_uuid with an index in the fixed_ips
table that we can use. This patch removes the unnecessary join and
ads an extra filter inside the OR to reject fixed_ips without
instances. In my test with 300000 fixed ips, this reduced the query
time from about 2.5 seconds to less than 0.01 seconds.

Change-Id: I26fb0dfaf5ff64bd70c947982de4ec1728c84856
Resolves-bug: #1369009
libvirt: remove pointless class in util test suite

The test_utils.py module had two separate test classes defined
for no real benefit. This is left over from merging tests from
two separate files together.

Change-Id: I808719955f90f7333aecbb9f3a1e19a377553edf
libvirt: convert test_vif.py to avoid DB usage

Remove use of the flavour APIs in the VIF test case avoiding
the need to hit the database. This allows conversion to the
NoDBTestCase which speeds up execution from 3 seconds to 0.3
seconds.

Partial-bug: #1369516
Change-Id: Ib0239b0f943baa1b1d81478b3b0d1e2ce1fb8722
correct _sync_instance_power_state log message

As reported by a user: the src and dest hosts listed were actually in
reverse order, making this log message quite confusing to
operators. Flipped to the correct requested order.

Change-Id: If9b31bceb56b66af70cddb88dbece7a180e4c2c8
Closes-Bug: #1370885
Merge "Fixes network_get_all_by_host to use indexes"
Merge "Don't elevate context when rescheduling"
Merge "correct _sync_instance_power_state log message"
Merge "libvirt: remove pointless class in util test suite"
Merge "libvirt: convert test_vif.py to avoid DB usage"