Commit 65f71daf authored by Matthias Schmitz's avatar Matthias Schmitz

Allow 'tcg' as accelerator in builder-qemu

* Using 'tcg' as accelerator for qemu-system allows packer to run in a
  virtual machine as no kvm or xen support is needed.

* Also document the default behavior if no accelerator is given in the
  documentation.
parent e39f555f
...@@ -249,9 +249,9 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) { ...@@ -249,9 +249,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") { if !(b.config.Accelerator == "kvm" || b.config.Accelerator == "xen" || b.config.Accelerator == "tcg") {
errs = packer.MultiErrorAppend( errs = packer.MultiErrorAppend(
errs, errors.New("invalid format, only 'kvm' or 'xen' are allowed")) errs, errors.New("invalid format, only 'kvm', 'xen' or 'tcg' are allowed"))
} }
if _, ok := netDevice[b.config.NetDevice]; !ok { if _, ok := netDevice[b.config.NetDevice]; !ok {
......
...@@ -91,8 +91,8 @@ each category, the available options are alphabetized and described. ...@@ -91,8 +91,8 @@ 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 "kvm" or "xen" and you must have that This may have a value of either "kvm", "xen" or "tcg" and you must have that
support in on the machine on which you run the builder. support 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