Update README on CPU features

This commit is contained in:
Gerben Meijer 2016-02-11 14:56:08 +01:00
parent c3f1e88066
commit 4554ceb6f0

View File

@ -30,6 +30,7 @@ welcome and can help a lot :-)
- [CDROMs](#cdroms) - [CDROMs](#cdroms)
- [Input](#input) - [Input](#input)
- [PCI device passthrough](#pci-device-passthrough) - [PCI device passthrough](#pci-device-passthrough)
- [CPU Features](#cpu-features)
- [No box and PXE boot](#no-box-and-pxe-boot) - [No box and PXE boot](#no-box-and-pxe-boot)
- [SSH Access To VM](#ssh-access-to-vm) - [SSH Access To VM](#ssh-access-to-vm)
- [Forwarded Ports](#forwarded-ports) - [Forwarded Ports](#forwarded-ports)
@ -542,6 +543,27 @@ Vagrant.configure("2") do |config|
end 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 ## 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: You can specify multiple USB devices to passthrough to the VM via `libvirt.usb`. The device can be specified by the following options: