Commit 0fd7bdd3 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/qemu: style

parent 1b23af26
...@@ -55,7 +55,6 @@ type config struct { ...@@ -55,7 +55,6 @@ type config struct {
common.PackerConfig `mapstructure:",squash"` common.PackerConfig `mapstructure:",squash"`
Accelerator string `mapstructure:"accelerator"` Accelerator string `mapstructure:"accelerator"`
QemuBinary string `mapstructure:"qemu_binary"`
BootCommand []string `mapstructure:"boot_command"` BootCommand []string `mapstructure:"boot_command"`
DiskInterface string `mapstructure:"disk_interface"` DiskInterface string `mapstructure:"disk_interface"`
DiskSize uint `mapstructure:"disk_size"` DiskSize uint `mapstructure:"disk_size"`
...@@ -71,6 +70,7 @@ type config struct { ...@@ -71,6 +70,7 @@ type config struct {
NetDevice string `mapstructure:"net_device"` NetDevice string `mapstructure:"net_device"`
OutputDir string `mapstructure:"output_directory"` OutputDir string `mapstructure:"output_directory"`
QemuArgs [][]string `mapstructure:"qemuargs"` QemuArgs [][]string `mapstructure:"qemuargs"`
QemuBinary string `mapstructure:"qemu_binary"`
ShutdownCommand string `mapstructure:"shutdown_command"` ShutdownCommand string `mapstructure:"shutdown_command"`
SSHHostPortMin uint `mapstructure:"ssh_host_port_min"` SSHHostPortMin uint `mapstructure:"ssh_host_port_min"`
SSHHostPortMax uint `mapstructure:"ssh_host_port_max"` SSHHostPortMax uint `mapstructure:"ssh_host_port_max"`
...@@ -111,10 +111,6 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) { ...@@ -111,10 +111,6 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
// Accumulate any errors // Accumulate any errors
errs := common.CheckUnusedConfig(md) errs := common.CheckUnusedConfig(md)
if b.config.QemuBinary == "" {
b.config.QemuBinary = "qemu-system-x86_64"
}
if b.config.DiskSize == 0 { if b.config.DiskSize == 0 {
b.config.DiskSize = 40000 b.config.DiskSize = 40000
} }
...@@ -135,6 +131,10 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) { ...@@ -135,6 +131,10 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
b.config.OutputDir = fmt.Sprintf("output-%s", b.config.PackerBuildName) b.config.OutputDir = fmt.Sprintf("output-%s", b.config.PackerBuildName)
} }
if b.config.QemuBinary == "" {
b.config.QemuBinary = "qemu-system-x86_64"
}
if b.config.RawBootWait == "" { if b.config.RawBootWait == "" {
b.config.RawBootWait = "10s" b.config.RawBootWait = "10s"
} }
......
...@@ -192,11 +192,6 @@ Optional: ...@@ -192,11 +192,6 @@ Optional:
qemu-system-x86 -m 1024m --no-acpi -netdev user,id=mynet0,hostfwd=hostip:hostport-guestip:guestport -device virtio-net,netdev=mynet0" qemu-system-x86 -m 1024m --no-acpi -netdev user,id=mynet0,hostfwd=hostip:hostport-guestip:guestport -device virtio-net,netdev=mynet0"
</pre> </pre>
* `qemu_binary` (string) - The name of the Qemu binary to look for. This
defaults to "qemu-system-x86_64", but may need to be changed for some
platforms. For example "qemu-kvm", or "qemu-system-i386" may be a better
choice for some systems.
* `output_directory` (string) - This is the path to the directory where the * `output_directory` (string) - This is the path to the directory where the
resulting virtual machine will be created. This may be relative or absolute. resulting virtual machine will be created. This may be relative or absolute.
If relative, the path is relative to the working directory when `packer` If relative, the path is relative to the working directory when `packer`
...@@ -204,6 +199,11 @@ Optional: ...@@ -204,6 +199,11 @@ Optional:
By default this is "output-BUILDNAME" where "BUILDNAME" is the name By default this is "output-BUILDNAME" where "BUILDNAME" is the name
of the build. of the build.
* `qemu_binary` (string) - The name of the Qemu binary to look for. This
defaults to "qemu-system-x86_64", but may need to be changed for some
platforms. For example "qemu-kvm", or "qemu-system-i386" may be a better
choice for some systems.
* `shutdown_command` (string) - The command to use to gracefully shut down * `shutdown_command` (string) - The command to use to gracefully shut down
the machine once all the provisioning is done. By default this is an empty the machine once all the provisioning is done. By default this is an empty
string, which tells Packer to just forcefully shut down the machine. string, which tells Packer to just forcefully shut down the machine.
......
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