virt: add helper module for determining VCPU topology

Introduce a nova/virt/hardware.py module which will container
helper APIs related to instance hardware configuration, for
use by virt driver impls. The first APIs added provide a
way for the virt driver to determine what VCPU topology to
expose to guest instances based on the image metadata and
flavor extra specs.

Blueprint: virt-driver-vcpu-topology
Change-Id: I419cd70497c3a4c3f18e77d75cb7e09c0b724465

Conflicts:
	nova/exception.py
libvirt: Add configuration of guest VCPU topology

Wire up the libvirt driver to honour the VCPU topology config
requested via the flavor extra specs / image meta. This is
only done for QEMU/KVM guests at this time. Although Xen is
technically capable of supporting this, it is not yet wired
up in libvirt itself.

Blueprint: virt-driver-vcpu-topology
Change-Id: I4540147af7b91e1dc463be63d19afbfcfc1216cb

Conflicts:
	nova/tests/virt/libvirt/test_libvirt.py
	nova/virt/libvirt/driver.py
libvirt: Don't pass None for image_meta parameter in tests

The get_guest_config() method in the libvirt driver expects to
have a non-None value for image_meta - the to_xml() caller
will ensure this is non-None. The test cases, however, are often
calling get_guest_config() directly instead of via to_xml() and
are passing None for image_meta. Fortunately this hasn't been a
problem historically but will become one as more of the XML code
requires access to the image_meta object. Ensure the test cases
all pass {} instead of None to addres this.

Blueprint: virt-driver-vcpu-topology
Change-Id: I30fc23ef1344fcdcfef10113c6679025f60f2036

Conflicts:
	nova/tests/virt/libvirt/test_libvirt.py
Minor tweaks for cherry-pick I didn't do quite right in backport.