Commit 78c53422 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

Merge branch 'master_add_support_for_tcg_accel_in_qemu_builder_' of...

Merge branch 'master_add_support_for_tcg_accel_in_qemu_builder_' of github.com:mattthias/packer into mattthias-master_add_support_for_tcg_accel_in_qemu_builder_

Conflicts:
	builder/qemu/builder.go
	website/source/docs/builders/qemu.html.markdown
parents 9cf046d9 65f71daf
...@@ -16,29 +16,36 @@ import ( ...@@ -16,29 +16,36 @@ 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,
"i82557b": true, "i82557b": true,
"i82559er": true, "i82559er": true,
"rtl8139": true, "rtl8139": true,
"e1000": true, "e1000": true,
"pcnet": true, "pcnet": true,
"virtio": true, "virtio": true,
"virtio-net": true, "virtio-net": true,
"virtio-net-pci": true, "virtio-net-pci": true,
"usb-net": true, "usb-net": true,
"i82559a": true, "i82559a": true,
"i82559b": true, "i82559b": true,
"i82559c": true, "i82559c": true,
"i82550": true, "i82550": true,
"i82562": true, "i82562": true,
"i82557a": true, "i82557a": true,
"i82557c": true, "i82557c": true,
"i82801": true, "i82801": true,
"vmxnet3": true, "vmxnet3": true,
"i82558a": true, "i82558a": true,
"i82558b": true, "i82558b": true,
} }
var diskInterface = map[string]bool{ var diskInterface = map[string]bool{
...@@ -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