From 4554ceb6f0e1cdce01c0c491d298b33345c74bc9 Mon Sep 17 00:00:00 2001 From: Gerben Meijer Date: Thu, 11 Feb 2016 14:56:08 +0100 Subject: [PATCH] Update README on CPU features --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index af6ed54..ce509cf 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ welcome and can help a lot :-) - [CDROMs](#cdroms) - [Input](#input) - [PCI device passthrough](#pci-device-passthrough) +- [CPU Features](#cpu-features) - [No box and PXE boot](#no-box-and-pxe-boot) - [SSH Access To VM](#ssh-access-to-vm) - [Forwarded Ports](#forwarded-ports) @@ -542,6 +543,27 @@ Vagrant.configure("2") do |config| end ``` +## CPU features + +You can specify CPU feature policies via `libvirt.cpu_feature`. Available options are +listed below. Note that both options are required: + +* `name` - The name of the feature for the chosen CPU (see libvirts `cpu_map.xml`) +* `policy` - The policy for this feature (one of `force`, `require`, `optional`, `disable` and `forbid` - see libvirt documentation) + +```ruby +Vagrant.configure("2") do |config| + config.vm.provider :libvirt do |libvirt| + # The feature will not be supported by virtual CPU. + libvirt.cpu_feature :name => 'hypervisor', :policy => 'disable' + # Guest creation will fail unless the feature is supported by host CPU. + libvirt.cpu_feature :name => 'vmx', :policy => 'require' + # The virtual CPU will claim the feature is supported regardless of it being supported by host CPU. + libvirt.cpu_feature :name => 'pdpe1gb', :policy => 'force' + end +end +``` + ## USB device passthrough You can specify multiple USB devices to passthrough to the VM via `libvirt.usb`. The device can be specified by the following options: