Commit 29676ccd authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

Merge branch 'mattthias-master_add_support_for_tcg_accel_in_qemu_builder_'

parents 9cf046d9 78c53422
...@@ -16,6 +16,13 @@ import ( ...@@ -16,6 +16,13 @@ import (
const BuilderId = "transcend.qemu" const BuilderId = "transcend.qemu"
var accels = map[string]struct{}{
"none": struct{}{},
"kvm": struct{}{},
"tcg": struct{}{},
"xen": struct{}{},
}
var netDevice = map[string]bool{ var netDevice = map[string]bool{
"ne2k_pci": true, "ne2k_pci": true,
"i82551": true, "i82551": true,
...@@ -256,9 +263,9 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) { ...@@ -256,9 +263,9 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
errs, errors.New("invalid format, only 'qcow2' or 'raw' are allowed")) errs, errors.New("invalid format, only 'qcow2' or 'raw' are allowed"))
} }
if !(b.config.Accelerator == "kvm" || b.config.Accelerator == "xen" || b.config.Accelerator == "none") { if _, ok := accels[b.config.Accelerator]; !ok {
errs = packer.MultiErrorAppend( errs = packer.MultiErrorAppend(
errs, errors.New("invalid format, only 'kvm' or 'xen' or 'none' are allowed")) errs, errors.New("invalid accelerator, only 'kvm', 'tcg', 'xen', or 'none' are allowed"))
} }
if _, ok := netDevice[b.config.NetDevice]; !ok { if _, ok := netDevice[b.config.NetDevice]; !ok {
......
...@@ -92,8 +92,9 @@ each category, the available options are alphabetized and described. ...@@ -92,8 +92,9 @@ each category, the available options are alphabetized and described.
### Optional: ### Optional:
* `accelerator` (string) - The accelerator type to use when running the VM. * `accelerator` (string) - The accelerator type to use when running the VM.
This may have a value of either "none", "kvm", or "xen" and you must have that This may have a value of either "none", "kvm", "tcg", or "xen" and you must have that
support in on the machine on which you run the builder. support in on the machine on which you run the builder. By default "kvm"
is used.
* `boot_command` (array of strings) - This is an array of commands to type * `boot_command` (array of strings) - This is an array of commands to type
when the virtual machine is first booted. The goal of these commands should when the virtual machine is first booted. The goal of these commands should
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment