Make update_service_capabilities() accept a list of capabilities

This makes it possible to send multiple capabilites by single RPC.

Change-Id: I7c1b75eada17181c4fe08c55992b34d66276f498
Remove unused bridge interfaces

If a network gateway of multi hosted network is unsed by any VM on the
host, we tear down it.
It is implemented only with the VLAN manager.

Fixes LP bug #1084651

Change-Id: Ia7e399de5b8ddf6ec252d38dfbb8762c4f14e3a5
Add vif_type to the VIF model

This is part of blueprint vif-plugging-improvements.

The patch has two parts:
1. Add support for vif_type to the VIF model
2. Read the vif_type from the Quantum port binding

The patch is backward compatible, that is, a quantum plugin
does not need to return the vif_type.

Change-Id: Ice772f00b22163da98b98a2c69a0a4ad3f5526ff
Use admin user to read Quantum port.

This is part of blueprint vif-plugging-improvements.

The port vif_type is only returned from Quantum when the user
is an admin user.

This patch ensures that when Nova reads the ports the user is an
admin user.

Change-Id: I4d1a2bfc6e3ae4ad63fe5c72eda32137713b31c6
Fix KeyError of log message in virt/libvirt/utils.py

Add arguments vg and lv for function check_size() so that locals() can get
them.

Fixes: bug #1088434

Change-Id: I6b5609fe1be7e0bf09a45e65eab91427059a89db
Port to argparse based cfg

Import latest cfg from oslo-incubator with these changes:

 Add deprecated --logdir common opt
 Add deprecated --logfile common opt.
 Allow nova and others to override some logging defaults
 Fixing the trim for ListOp when reading from config file
 Fix set_default() with boolean CLI options
 Improve cfg's argparse sub-parsers support
 Hide the GroupAttr conf and group attributes
 Fix regression with cfg CLI arguments
 Fix broken --help with CommonConfigOpts
 Fix ListOpt to trim whitespace
 updating sphinx documentation
 Don't reference argparse._StoreAction
 Fix minor coding style issue
 Remove ConfigCliParser class
 Add support for positional arguments
 Use stock argparse behaviour for optional args
 Use stock argparse --usage behaviour
 Use stock argparse --version behaviour
 Remove add_option() method
 Completely remove cfg's disable_interspersed_args()
 argparse support for cfg

The main cfg API change is that CONF() no longer returns the un-parsed
CLI arguments. To handle these args, you need to use the support for
positional arguments or sub-parsers.

Switching nova-manage to use sub-parser based CLI arguments means the
following changes in behaviour:

 - no more lazy matching of commands - e.g. 'nova-manage proj q' will
   no longer work. If we find out about common abbreviations used in
   peoples' scripts, we can easily add those.

 - the help output displayed if you run nova-manage without any args
   (or just a category) has changed

 - 'nova-manage version list' is no longer equivalent to
   'nova-manage version'

Change-Id: I19ef3a1c00e97af64d199e27cb1cdc5c63b46a82
Properly scope isolated hosts config opts

The isolated_hosts and isolated_images options are only used by the
isolated hosts scheduler filter, so move them there.

blueprint: scope-config-opts
Change-Id: Ia89b613d7d934a0072f262add039fe14ef236334
Allow conductor exceptions to pass over RPC silently

When one service performs an operation on behalf of another, the
act of passing back an exception (even a known one) causes a lot
of scary log messages about the (presumed to be) error case.

This patch applies the new client_exceptions decorator to methods
in the conductor manager to prevent excess logging for known
situations.

Fixes bug 1084706

Change-Id: I56e472b0f08d584f5bbe5181ca909f2c11352120
Allow rpc-silent FloatingIP exceptions in n-net

This patch uses the new client_exceptions functionality to squelch
some errant exception dumps in the RPC layer.

Fixes bug 1084707

Change-Id: I31a783a67d7722751fcfeafab40e781dc762dd65
Add support for libvirt domain <sysinfo> XML config

Libvirt domains can have system metadata defined in a <sysinfo>
XML element. For the x86 platform with KVM guests, this can then
be used to populate the SMBIOS data tables

            <sysinfo>
              <bios>
                <entry name="vendor">Acme</entry>
              </bios>
              <system>
                <entry name="manufacturer">Acme</entry>
                <entry name="product">Wile Coyote</entry>
                <entry name="uuid">c7a5fdbd-edaf-9455-926a-d65c16db1809</entry>
              </system>
            </sysinfo>

Change-Id: Ib4980ddc2f558921893a7e208e304ba59636e430
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add support for libvirt domain <smbios> XML config

On x86 platforms the SMBIOS data tables can be customized
using the <smbios> XML config.

For example, to populate them based on the <sysinfo> data

            <smbios mode="sysinfo"/>

Or to copy the host's SMBIOS

            <smbios mode="host"/>

Change-Id: Ia4e6c1d9b0d66c58700ccf0f0fd97fa302aba64d
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add support for parsing the <uuid> from libvirt host capabilities

The libvirt host capabilities provide a <uuid> element which
uniquely identifies the host platform.

Change-Id: Ic619a24b4b90c757b868aa78396d6cdee56ccb4b
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Implement an XML matcher

Uses the "Matcher" interface of the testtools assertThat() call to
compare XML document strings safely.  This will result in more
useful error results and will ignore attribute ordering issues
that caused problems with tests affected by lxml version skew.

Also converts test_libvirt_config to use XMLMatches, to
demonstrate its use.

Change-Id: I7821557a73eb8b5aca823cfccd02b4b660e0ffdb
Properly scope password options

enable_instance_password is only used in api.openstack.compute.servers
so move it there.

password_length is passed as a parameter to every generate_password()
call, so just move it into nova.utils and have generate_password()
use it by default.

Note: using a config option as the default value of a kwarg isn't a
good idea because the option value is read when the function is defined
which means you can't control its value during unit tests. Instead we
use password=None as the default.

blueprint: scope-config-opts
Change-Id: I445174515fc2eacc56c7cccecadadd2a7e57d4f4
Move some opts into nova.utils

Both rootwrap_config and instance_usage_audit_period are only used in
nova.utils.

blueprint: scope-config-opts
Change-Id: Ide687af9b302f97f91a64b79f502a59fe7a715a3
Add Jian Wen to .mailmap

To follow company policy

Change-Id: I8737bfddba93b1a822de57eaad83c27e18e4a534
Autodetect nbd devices.

This means we don't need to the max_nbd_devices flag any more at all.
This patch also moves the internal representation of the list of
available nbd devices to not including the leading /dev/, but that is
not exposed as a change in the interface to the class.

Resolves bug 861504 and its duplicate 1088339.

DocImpact.

Change-Id: I5c6218122ab09781d8a2ecd6d8b76a74be4a6e91
Fix for correctly parsing snapshot uuid in ec2api

* EC2 snapshot id correctly translated instead of volume uuid.
* Add unit tests changes for the existing test.

Fixes LP Bug #1089371

Change-Id: Id650ba53dc6cda946531493e3887a01fc5d9bda4
Merge "Properly scope isolated hosts config opts"
Adds API Sample tests for DiskConfig extension.

Partially implements blueprint nova-api-samples
Fixes bug 1070158

Change-Id: Ied2efc3ae17599b61133247273a7a4bec9020927