Allow setting cpu_mode
diff --git a/README.rst b/README.rst
index cc6f92b..7e3b28d 100644
--- a/README.rst
+++ b/README.rst
@@ -399,6 +399,20 @@
glance image-update --property hw_scsi_model=virtio-scsi <image>
glance image-update --property hw_disk_bus=scsi <image>
+libvirt CPU mode
+----------------
+
+Allow setting the model of CPU that is exposed to a VM. This allows better
+support live migration between hypervisors with different hardware, among other
+things. Defaults to host-passthrough.
+
+.. code-block:: yaml
+
+ nova:
+ compute:
+ cpu_mode: host-model
+
+
Documentation and Bugs
======================
diff --git a/nova/files/mitaka/nova-compute.conf.Debian b/nova/files/mitaka/nova-compute.conf.Debian
index ba9a0f0..1c58484 100644
--- a/nova/files/mitaka/nova-compute.conf.Debian
+++ b/nova/files/mitaka/nova-compute.conf.Debian
@@ -105,7 +105,7 @@
{%- endif %}
[libvirt]
-cpu_mode = host-passthrough
+cpu_mode = {{ compute.get('cpu_mode', 'host-passthrough') }}
virt_type = kvm
inject_partition=-2
inject_password=False
diff --git a/nova/files/newton/nova-compute.conf.Debian b/nova/files/newton/nova-compute.conf.Debian
index f49529f..cac7d40 100644
--- a/nova/files/newton/nova-compute.conf.Debian
+++ b/nova/files/newton/nova-compute.conf.Debian
@@ -119,7 +119,7 @@
{%- endif %}
[libvirt]
-cpu_mode = host-passthrough
+cpu_mode = {{ compute.get('cpu_mode', 'host-passthrough') }}
virt_type = kvm
inject_partition=-2
inject_password=False
diff --git a/nova/files/ocata/nova-compute.conf.Debian b/nova/files/ocata/nova-compute.conf.Debian
index b13d4a8..97a3f70 100644
--- a/nova/files/ocata/nova-compute.conf.Debian
+++ b/nova/files/ocata/nova-compute.conf.Debian
@@ -5878,7 +5878,7 @@
#
# From nova.conf
#
-cpu_mode = host-passthrough
+cpu_mode = {{ compute.get('cpu_mode', 'host-passthrough') }}
virt_type = kvm
inject_partition=-2
inject_password=True