diff --git a/src/mkvm/vmdesc.py b/src/mkvm/vmdesc.py index 3f6e2d9..4fe69f5 100644 --- a/src/mkvm/vmdesc.py +++ b/src/mkvm/vmdesc.py @@ -74,6 +74,7 @@ class VirtualMachine(object): 'fqdn', 'ram', 'vcpus', + 'cpu', 'net_ifaces', 'console', 'graphics', @@ -101,6 +102,7 @@ class VirtualMachine(object): self.fqdn = None self.ram = 256 * 2 ** 20 self.vcpus = 1 + self.cpu = 'host-model' self.net_ifaces = [] self.console = 'virtio' self.graphics = 'spice' @@ -279,6 +281,9 @@ class VirtualMachine(object): elm_vcpu = etree.SubElement(root, 'vcpu', placement='static') elm_vcpu.text = str(self.vcpus) + if self.cpu: + elm_cpu = etree.SubElement(root, 'cpu', mode=self.cpu) + elm_os = etree.SubElement(root, 'os') elm_type = etree.SubElement(elm_os, 'type', arch='x86_64') elm_type.text = 'hvm'